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

Return NULL instead of throwing when the class name is invalid #5294

Merged
merged 1 commit into from
Mar 28, 2019

Conversation

keithc-ca
Copy link
Contributor

Prior to #4919, ClassLoader.defineClassImpl() would check if the given
class name and immediately throw NoClassDefFoundError if it was invalid.
Beginning with Java 12, JavaLangAccess.defineClass() is used to define
accessor classes (with invalid names). The name validation must still
be done, but throwing the exception must be delayed until it can be
determined to be the appropriate response. The invalid name is signalled
with a bit in the options parameter to defineClassCommon() which must
not set a pending exception in that case.

This is a replay of #5284 for the 0.14 release branch.

Prior to eclipse-openj9#4919, ClassLoader.defineClassImpl() would check if the given
class name and immediately throw NoClassDefFoundError if it was invalid.
Beginning with Java 12, JavaLangAccess.defineClass() is used to define
accessor classes (with invalid names). The name validation must still
be done, but throwing the exception must be delayed until it can be
determined to be the appropriate response. The invalid name is signalled
with a bit in the options parameter to defineClassCommon() which must
not set a pending exception in that case.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
@keithc-ca keithc-ca requested a review from gacholio March 28, 2019 15:39
@pshipton pshipton merged commit 989d8c1 into eclipse-openj9:v0.14.0-release Mar 28, 2019
@keithc-ca keithc-ca deleted the loading-0.14 branch March 28, 2019 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants