javaparser-visited
javaparser-visited copied to clipboard
IllegalStateException when running the ResolveTypeInContext example from the book
trafficstars
When trying to run the ResolveTypeInContext example from the book I get an Exception:
java.lang.IllegalStateException: The parent of this TypeSolver cannot be itself.
at com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver.setParent(ClassLoaderTypeSolver.java:60)
It occurs for this statement:
reflectionTypeSolver.setParent(reflectionTypeSolver);
(line 23 in https://github.com/javaparser/javaparser-visited/blob/master/src/main/java/org/javaparser/examples/chapter5/ResolveTypeInContext.java)
Removing the statement make the exception go away.
May be a duplicate of https://github.com/javaparser/javaparser-visited/issues/28
Thanks for the report.
Code samples and book should now reflect this.