Exemple #1
0
 public boolean visit(ClassDeclaration s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("name", s.getName());
   xmlWriter.startTag("ClassDeclaration", parameters);
   return true;
 }
 @Test(result = {"m1()", "m2()", "m2(int)"})
 Collection<MethodDeclaration> getMethods() {
   return nested.getMethods();
 }
 @Test(result = {"null"})
 ClassType objectHasNoSuperclass() {
   return object.getSuperclass();
 }
 @Test(result = "java.io.Serializable")
 Collection<InterfaceType> getSuperinterfaces() {
   return nested.getSuperinterfaces();
 }
 // Check for default constructor.
 // 4997614: visitConstructionDeclaration reports info when there is no ctor
 @Test(result = {"NestedClass()"})
 Collection<ConstructorDeclaration> getConstructors2() {
   return nested.getConstructors();
 }
 @Test(result = "ClassDecl.NestedClass")
 String getQualifiedName2() {
   return nested.getQualifiedName();
 }
 @Test(result = "java.lang.Object")
 String getQualifiedName3() {
   return object.getQualifiedName();
 }
 @Test(result = "java.lang")
 PackageDeclaration getPackage2() {
   return object.getPackage();
 }
 @Test(result = "T")
 Collection<TypeParameterDeclaration> getFormalTypeParameters2() {
   return nested.getFormalTypeParameters();
 }
 @Test(result = "ClassDecl")
 TypeDeclaration getDeclaringType2() {
   return nested.getDeclaringType();
 }
 @Test(result = "NestedClass")
 String getSimpleName2() {
   return nested.getSimpleName();
 }
 // Check that static nested class has "static" modifier, even though
 // the VM doesn't set that bit.
 @Test(result = {"private", "static", "strictfp"})
 Collection<Modifier> getModifiers2() {
   return nested.getModifiers();
 }