< prev index next >

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

Print this page
*** 222,11 ***
          if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
              m.flags_field |= Flags.VARARGS;
  
          localEnv.info.scope.leave();
          if (chk.checkUnique(tree.pos(), m, enclScope)) {
!         enclScope.enter(m);
          }
  
          annotate.annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
          // Visit the signature of the method. Note that
          // TypeAnnotate doesn't descend into the body.
--- 222,11 ---
          if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
              m.flags_field |= Flags.VARARGS;
  
          localEnv.info.scope.leave();
          if (chk.checkUnique(tree.pos(), m, enclScope)) {
!             enclScope.enter(m);
          }
  
          annotate.annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
          // Visit the signature of the method. Note that
          // TypeAnnotate doesn't descend into the body.

*** 299,11 ***
              v.flags_field |= HASINIT;
              if ((v.flags_field & FINAL) != 0 &&
                  needsLazyConstValue(tree.init)) {
                  Env<AttrContext> initEnv = getInitEnv(tree, env);
                  initEnv.info.enclVar = v;
!                 v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
              }
          }
  
          if(!(Feature.UNNAMED_VARIABLES.allowedInSource(source) && tree.sym.isUnnamedVariable())) {
              if (chk.checkUnique(tree.pos(), v, enclScope)) {
--- 299,13 ---
              v.flags_field |= HASINIT;
              if ((v.flags_field & FINAL) != 0 &&
                  needsLazyConstValue(tree.init)) {
                  Env<AttrContext> initEnv = getInitEnv(tree, env);
                  initEnv.info.enclVar = v;
!                 initEnv = initEnv(tree, initEnv);
+                 initEnv.info.ctorPrologue = (v.owner.kind == TYP && v.owner.isValueClass() && !v.isStatic());
+                 v.setLazyConstValue(initEnv, attr, tree);
              }
          }
  
          if(!(Feature.UNNAMED_VARIABLES.allowedInSource(source) && tree.sym.isUnnamedVariable())) {
              if (chk.checkUnique(tree.pos(), v, enclScope)) {
< prev index next >