ClassScope extends AbstractJavaScope { public String getClassName() { return this.className; } 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 testAnonymousInnerClassName() { ClassNameDeclaration classDeclaration = new ClassNameDeclaration(null); ClassScope s = new ClassScope("Foo", classDeclaration); s = new ClassScope(classDeclaration); assertEquals("Anonymous$1", s.getClassName()); s = new ClassScope(classDeclaration); assertEquals("Anonymous$2", s.getClassName()); }
@Test public void testClassName() { ASTCompilationUnit acu = parseCode(CLASS_NAME); ASTClassOrInterfaceDeclaration n = acu.findDescendantsOfType(ASTClassOrInterfaceDeclaration.class).get(0); assertEquals("Foo", n.getScope().getEnclosingScope(ClassScope.class).getClassName()); }