Skip to content

JNI should load NativeStaticallyReferencedJniMethods before other cla…#245

Closed
Scottmitch wants to merge 1 commit intonetty:masterfrom
Scottmitch:jni_load_statics
Closed

JNI should load NativeStaticallyReferencedJniMethods before other cla…#245
Scottmitch wants to merge 1 commit intonetty:masterfrom
Scottmitch:jni_load_statics

Conversation

@Scottmitch
Copy link
Copy Markdown
Member

…sses

Motivation:
The point of NativeStaticallyReferencedJniMethods is to make JNI values usable in a static context in Java and not worry about cyclic class loading issues. However if we don't explicitly load the NativeStaticallyReferencedJniMethods class from JNI there is a chance another class which statically references a value in NativeStaticallyReferencedJniMethods is loaded first, and creates a circular class loading issue.

Modifications:

  • JNI OnLoad should ensure NativeStaticallyReferencedJniMethods is loaded before other tcnative classes

Result:
Methods from NativeStaticallyReferencedJniMethods can be used in a static context from Java without cyclic class loading issues.

…sses

Motivation:
The point of NativeStaticallyReferencedJniMethods is to make JNI values usable in a static context in Java and not worry about cyclic class loading issues. However if we don't explicitly load the NativeStaticallyReferencedJniMethods class from JNI there is a chance another class which statically references a value in NativeStaticallyReferencedJniMethods is loaded first, and creates a circular class loading issue.

Modifications:
- JNI OnLoad should ensure NativeStaticallyReferencedJniMethods is loaded before other tcnative classes

Result:
Methods from NativeStaticallyReferencedJniMethods can be used in a static context from Java without cyclic class loading issues.
@Scottmitch Scottmitch added this to the 2.0.0.Final milestone Mar 7, 2017
@Scottmitch Scottmitch self-assigned this Mar 7, 2017
@Scottmitch Scottmitch requested a review from normanmaurer March 7, 2017 01:33
@Scottmitch
Copy link
Copy Markdown
Member Author

master (c1946a8)

@Scottmitch Scottmitch closed this Mar 7, 2017
@Scottmitch Scottmitch deleted the jni_load_statics branch March 7, 2017 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants