Skip to content
New issue

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

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

Already on GitHub? # to your account

Support for Class.getDeclaredClasses() #630

Closed
dsyer opened this issue Aug 22, 2018 · 3 comments
Closed

Support for Class.getDeclaredClasses() #630

dsyer opened this issue Aug 22, 2018 · 3 comments
Assignees

Comments

@dsyer
Copy link

dsyer commented Aug 22, 2018

I see from https://github.com/oracle/graal/blob/master/substratevm/REFLECTION.md that substratevm already supports quite a few methods on Class. But apparently getDeclaredClasses() is not one of them? It would be useful.

This is what happens if you try it (at runtime):

Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Unsupported method java.lang.Class.getDeclaredClasses0() is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class
	at java.lang.Throwable.<init>(Throwable.java:265)
	at java.lang.Error.<init>(Error.java:70)
	at com.oracle.svm.core.jdk.UnsupportedFeatureError.<init>(UnsupportedFeatureError.java:31)
	at com.oracle.svm.core.jdk.Target_com_oracle_svm_core_util_VMError.unsupportedFeature(VMErrorSubstitutions.java:109)
	at java.lang.Class.getDeclaredClasses0(Class.java)
	at java.lang.Class.getDeclaredClasses(Class.java:1867)

This is from an image build with JSON containing

	{
		"name": "java.lang.Class",
		"allDeclaredConstructors": true,
		"allPublicConstructors": true,
		"allDeclaredMethods": true,
		"allPublicMethods": true
	},

(so what that does, I have no idea).

@cstancu cstancu self-assigned this Aug 22, 2018
@sdeleuze
Copy link
Collaborator

sdeleuze commented Sep 6, 2018

FYI this issue is blocking with no known workaround for Spring Boot (since required for our @Configuration post processing)

@sdeleuze
Copy link
Collaborator

sdeleuze commented Sep 6, 2018

I have created a repro project for this issue.

@cstancu
Copy link
Member

cstancu commented Mar 12, 2019

This has been fixed as of 61bb4f5 and it should be available in RC13.

@cstancu cstancu closed this as completed Mar 12, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants