Skip to content

Tighten the generic bounds for Structure#newInstance#898

Merged
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
matthiasblaesing:struct_newinstance_generic
Jan 11, 2018
Merged

Tighten the generic bounds for Structure#newInstance#898
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
matthiasblaesing:struct_newinstance_generic

Conversation

@matthiasblaesing
Copy link
Copy Markdown
Member

The signature was: Structure newInstance(Class<?> type) requiring
an explicit cast after the call. The the new signature introduces a
type parameter T with an upper bound of com.sun.jna.Structure:

<T extends Structure> T newInstance(Class<T> type)

The companion, that takes an init pointer was also updated:

<T extends Structure> T newInstance(Class<T> type, Pointer init)

Closes: #889

The signature was: `Structure newInstance(Class<?> type)` requiring
an explicit cast after the call. The the new signature introduces a 
type parameter `T` with an upper bound of `com.sun.jna.Structure`: 

<T extends Structure> T newInstance(Class<T> type)`

The companion, that takes an init pointer was also updated:

<T extends Structure> T newInstance(Class<T> type, Pointer init)

Closes: java-native-access#889
@matthiasblaesing matthiasblaesing force-pushed the struct_newinstance_generic branch from a9d7754 to a9a2c43 Compare December 24, 2017 14:02
@matthiasblaesing matthiasblaesing merged commit 7b66282 into java-native-access:master Jan 11, 2018
@matthiasblaesing matthiasblaesing deleted the struct_newinstance_generic branch January 11, 2018 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant