< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java

Print this page
*** 918,11 ***
                          Env<AttrContext> supClassEnv = enter.getEnv(supClass);
                          if (supClass.isSealed() &&
                              !supClass.isPermittedExplicit &&
                              supClassEnv != null &&
                              supClassEnv.toplevel == baseEnv.toplevel) {
!                             supClass.permitted = supClass.permitted.append(sym);
                          }
                      }
                  }
              }
              // attribute (explicit) permits of the current class:
--- 918,11 ---
                          Env<AttrContext> supClassEnv = enter.getEnv(supClass);
                          if (supClass.isSealed() &&
                              !supClass.isPermittedExplicit &&
                              supClassEnv != null &&
                              supClassEnv.toplevel == baseEnv.toplevel) {
!                             supClass.addPermittedSubclass(sym, tree.pos);
                          }
                      }
                  }
              }
              // attribute (explicit) permits of the current class:

*** 931,11 ***
                  List<JCExpression> permittedTrees = tree.permitting;
                  for (JCExpression permitted : permittedTrees) {
                      Type pt = attr.attribBase(permitted, baseEnv, false, false, false);
                      permittedSubtypeSymbols.append(pt.tsym);
                  }
!                 sym.permitted = permittedSubtypeSymbols.toList();
              }
          }
      }
  
      private abstract class AbstractMembersPhase extends Phase {
--- 931,11 ---
                  List<JCExpression> permittedTrees = tree.permitting;
                  for (JCExpression permitted : permittedTrees) {
                      Type pt = attr.attribBase(permitted, baseEnv, false, false, false);
                      permittedSubtypeSymbols.append(pt.tsym);
                  }
!                 sym.setPermittedSubclasses(permittedSubtypeSymbols.toList());
              }
          }
      }
  
      private abstract class AbstractMembersPhase extends Phase {
< prev index next >