javaparser-visited
javaparser-visited copied to clipboard
ResolveTypeInContext sample throws an exception
trafficstars
The example for ResolveTypeInContext in the book throws an exception
Exception in thread "main" java.lang.IllegalStateException: The parent of this TypeSolver cannot be itself.
at com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver.setParent(ClassLoaderTypeSolver.java:60)
Presumably the line should be removed (as the parent is overridden anyway from combinedSolver.add(reflectionTypeSolver)
(also in the same example Navigator.findNodeOfGivenClass(cu, FieldDeclaration.class); is deprecated