use of com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserAnonymousClassDeclaration in project javaparser by javaparser.
the class MethodsResolutionTest method thisInAnonymousClass.
@Test
public void thisInAnonymousClass() {
CompilationUnit cu = parseSample("ThisInAnonymousClass");
ClassOrInterfaceDeclaration clazz = Navigator.demandClass(cu, "Bar");
ThisExpr thisExpression = Navigator.findNodeOfGivenClass(clazz, ThisExpr.class);
ResolvedType type = JavaParserFacade.get(new ReflectionTypeSolver()).getType(thisExpression);
assertEquals(true, type.isReferenceType());
assertEquals(true, type.asReferenceType().getTypeDeclaration() instanceof JavaParserAnonymousClassDeclaration);
}
Aggregations