Skip to content

Support for Class.getDeclaredClasses() #630

Closed

Description

@dsyer

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).

Activity

  1. self-assigned this
    on Aug 22, 2018
  2. sdeleuze commented on Sep 6, 2018

    @sdeleuze
    Collaborator

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

  3. sdeleuze commented on Sep 6, 2018

    @sdeleuze
    Collaborator

    I have created a repro project for this issue.

  4. cstancu commented on Mar 12, 2019

    @cstancu
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions