< prev index next >

test/langtools/tools/javac/classfiles/attributes/innerclasses/InnerClassesInAnonymousClassTest.java

Print this page
*** 57,11 ***
      }
  
      @Override
      public List<TestCase> generateTestCases() {
          currentClassType = ClassType.CLASS;
!         setPrefix("class Anonymous {} {new Anonymous() {");
          List<TestCase> sources = super.generateTestCases();
  
          currentClassType = ClassType.INTERFACE;
          setPrefix("interface Anonymous {} {new Anonymous() {");
          sources.addAll(super.generateTestCases());
--- 57,11 ---
      }
  
      @Override
      public List<TestCase> generateTestCases() {
          currentClassType = ClassType.CLASS;
!         setPrefix("class Anonymous { int f; } {new Anonymous() {"); // impose identity to make testing predictable.
          List<TestCase> sources = super.generateTestCases();
  
          currentClassType = ClassType.INTERFACE;
          setPrefix("interface Anonymous {} {new Anonymous() {");
          sources.addAll(super.generateTestCases());

*** 76,8 ***
  
      @Override
      public void getAdditionalFlags(Map<String, Set<String>> class2Flags, ClassType type, Modifier... flags) {
          super.getAdditionalFlags(class2Flags, type, flags);
          class2Flags.put("Anonymous", getFlags(currentClassType, Arrays.asList(flags)));
!         class2Flags.put("1", new HashSet<>() {});
      }
  }
--- 76,8 ---
  
      @Override
      public void getAdditionalFlags(Map<String, Set<String>> class2Flags, ClassType type, Modifier... flags) {
          super.getAdditionalFlags(class2Flags, type, flags);
          class2Flags.put("Anonymous", getFlags(currentClassType, Arrays.asList(flags)));
!         class2Flags.put("1", new HashSet<>(Arrays.asList("ACC_IDENTITY")));
      }
  }
< prev index next >