Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten the generic bounds for Structure#newInstance #898

Conversation

matthiasblaesing
Copy link
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 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