ClassScope extends AbstractJavaScope { public Class<?> resolveType(final String name) { return this.getEnclosingScope(SourceFileScope.class).resolveType(qualifyTypeName(name)); } ClassScope(final String className, final ClassNameDeclaration classNameDeclaration);  ClassScope(final ClassNameDeclaration classNameDeclaration); ClassNameDeclaration getClassDeclaration(); void setIsEnum(boolean isEnum); Map<ClassNameDeclaration, List<NameOccurrence>> getClassDeclarations(); Map<MethodNameDeclaration, List<NameOccurrence>> getMethodDeclarations(); Map<VariableNameDeclaration, List<NameOccurrence>> getVariableDeclarations(); @Override Set<NameDeclaration> addNameOccurrence(NameOccurrence occurrence); String getClassName(); Class<?> resolveType(final String name); @Override String toString();  }
@Test public void testNestedClassesOfImportResolution() { ASTCompilationUnit acu = parseCode(NESTED_CLASSES_OF_IMPORT); final ASTClassOrInterfaceDeclaration n = acu.findDescendantsOfType(ASTClassOrInterfaceDeclaration.class).get(0); final ClassScope c = (ClassScope) n.getScope(); assertEquals(EnumTest.class, c.resolveType("TheInnerClass.EnumTest")); }
@Test public void testNestedClassesResolution() { final ASTClassOrInterfaceDeclaration n = java.parseClass(InnerClass.class) .findDescendantsOfType(ASTClassOrInterfaceDeclaration.class).get(0); final ClassScope c = (ClassScope) n.getScope(); assertEquals(InnerClass.class, c.resolveType("InnerClass")); assertEquals(TheInnerClass.class, c.resolveType("InnerClass.TheInnerClass")); assertEquals(TheInnerClass.class, c.resolveType("TheInnerClass")); }
@Test public void testImportNestedClassesResolution() { ASTCompilationUnit acu = parseCode(IMPORT_NESTED_CLASSES); final ASTClassOrInterfaceDeclaration n = acu.findDescendantsOfType(ASTClassOrInterfaceDeclaration.class).get(0); final ClassScope c = (ClassScope) n.getScope(); assertEquals(EnumTest.class, c.resolveType("EnumTest")); }