eclipse / xtext-lib

Eclipse Xtext™ Libraries
https://www.eclipse.org/Xtext/
Eclipse Public License 2.0
19 stars 33 forks source link

ReflectExtensions.invoke does not work for static methods in newer java versions #513

Closed cdietrich closed 1 year ago

cdietrich commented 1 year ago

ReflectExtensions.invoke does not work for static methods in newer java versions

java.lang.IllegalArgumentException: non-null object for public static void MyFile.main(java.lang.String[])
    at java.base/java.lang.reflect.AccessibleObject.canAccess(AccessibleObject.java:466)
    at org.eclipse.xtext.xbase.lib.util.ReflectExtensions.invoke(ReflectExtensions.java:122)
    at org.xtext.scripting.tests.ExecutionTest.lambda$0(ExecutionTest.java:62)
    at org.eclipse.xtext.xbase.testing.CompilationTestHelper.compile(CompilationTestHelper.java:248)
    at org.eclipse.xtext.xbase.testing.CompilationTestHelper.compile(CompilationTestHelper.java:197)
    at org.xtext.scripting.tests.ExecutionTest.compileAndExecuteMainAndExpect(ExecutionTest.java:76)
    at org.xtext.scripting.tests.ExecutionTest.testHelloWorld(ExecutionTest.java:42)