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

JAVASSIST-242: Demonstrates a race condition in DefineClassHelper + proposed fix #243

Merged
merged 2 commits into from Jan 27, 2019

Conversation

michalkurka
Copy link
Contributor

@michalkurka michalkurka commented Jan 25, 2019

Issue: #242

michalkurka added 2 commits January 25, 2019 11:28
Don't try to clean-up after making a protected-final method accessible.
No synchronization with concurrent access can cause errors.
@michalkurka michalkurka changed the title JAVASSIST-242: Demonstrates a race condition in DefineClassHelper JAVASSIST-242: Demonstrates a race condition in DefineClassHelper + proposed fix Jan 25, 2019
@@ -219,9 +219,6 @@ private final Method getDefineClassMethod() {
if (e instanceof RuntimeException) throw (RuntimeException) e;
throw new CannotCompileException(e);
}
finally {
SecurityActions.setAccessible(defineClass, false);
Copy link

@Pscheidl Pscheidl Jan 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's quote the reason I approved:

As other posters have indicated, setAccessible is only applicable to that instance, so setting the accessibility back to its original state is not needed.

@chibash chibash merged commit 023f755 into jboss-javassist:master Jan 27, 2019
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.

None yet

3 participants