You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" spoon.support.SpoonClassNotFoundException: cannot load class: $Poor$Name
at spoon.support.reflect.reference.CtTypeReferenceImpl.findClass(CtTypeReferenceImpl.java:164)
at spoon.support.reflect.reference.CtTypeReferenceImpl.getActualClass(CtTypeReferenceImpl.java:146)
at spoon.support.reflect.reference.CtTypeReferenceImpl.getModifiers(CtTypeReferenceImpl.java:491)
at spoon.support.reflect.reference.CtTypeReferenceImpl.canAccess(CtTypeReferenceImpl.java:621)
at spoon.support.reflect.reference.CtTypeReferenceImpl.getAccessType(CtTypeReferenceImpl.java:691)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.visitCtTypeReference(DefaultJavaPrettyPrinter.java:1824)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.visitCtTypeReference(DefaultJavaPrettyPrinter.java:1794)
at spoon.support.reflect.reference.CtTypeReferenceImpl.accept(CtTypeReferenceImpl.java:83)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.scan(DefaultJavaPrettyPrinter.java:345)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.visitCtMethod(DefaultJavaPrettyPrinter.java:1369)
at spoon.support.reflect.declaration.CtMethodImpl.accept(CtMethodImpl.java:73)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.scan(DefaultJavaPrettyPrinter.java:345)
at spoon.reflect.visitor.ElementPrinterHelper.writeElementList(ElementPrinterHelper.java:196)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.visitCtClass(DefaultJavaPrettyPrinter.java:622)
at spoon.support.reflect.declaration.CtClassImpl.accept(CtClassImpl.java:68)
at spoon.reflect.visitor.DefaultJavaPrettyPrinter.scan(DefaultJavaPrettyPrinter.java:345)
at spoon.support.reflect.declaration.CtElementImpl.toString(CtElementImpl.java:283)
at java.lang.String.valueOf(String.java:2994)
at java.io.PrintStream.println(PrintStream.java:821)
at se.kth.App.main(App.java:25)
Caused by: java.lang.ClassNotFoundException: $Poor$Name
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at spoon.support.reflect.reference.CtTypeReferenceImpl.findClass(CtTypeReferenceImpl.java:162)
... 19 more
I'm working on a fix, but if anyone has any ideas, I'm all ears!
The text was updated successfully, but these errors were encountered:
nharrand
changed the title
Parsing class containing $ with a nested classe fails
Parsing class with name containing $ with a nested classe fails
Mar 2, 2018
nharrand
changed the title
Parsing class with name containing $ with a nested classe fails
Parsing class with name containing $ and with a nested classe fails
Mar 2, 2018
The current behavior when trying to resolve a referenced type is to assume that $ is only used for nested (and anonymous) types. So when trying to resolve the class $Poor$Name$Choice it try to resolve $Poor which does not exist.
What we can do is to change TypeFactory.get(final String qualifiedName) to check if the type is already known at the beginning of the method instead of just doing it at the end. It is more a workaround than a fix though...
with file
$Poor$Name.java
containing:produces the following exceptions:
(This issue is the minimalistic version of what I encountered working on https://github.com/google/gson/blob/master/gson/src/main/java/com/google/gson/internal/%24Gson%24Types.java )
I'm working on a fix, but if anyone has any ideas, I'm all ears!
The text was updated successfully, but these errors were encountered: