jdk/src/share/classes/sun/tools/tree/FieldExpression.java
changeset 21278 ef8a3a2a72f2
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
21277:bd380b80f9ea 21278:ef8a3a2a72f2
   152                 && !ctxClass.protectedAccess(env, field, rty)) {
   152                 && !ctxClass.protectedAccess(env, field, rty)) {
   153                 env.error(where, "invalid.protected.type.use", id, ctxClass, rty);
   153                 env.error(where, "invalid.protected.type.use", id, ctxClass, rty);
   154                 return t;
   154                 return t;
   155             }
   155             }
   156 
   156 
   157             // These were ommitted earlier in calls to 'toType', but I can't
   157             // These were omitted earlier in calls to 'toType', but I can't
   158             // see any reason for that.  I think it was an oversight.  See
   158             // see any reason for that.  I think it was an oversight.  See
   159             // 'checkCommon' and 'checkInnerClass'.
   159             // 'checkCommon' and 'checkInnerClass'.
   160             innerClass.noteUsedBy(ctxClass, where, env);
   160             innerClass.noteUsedBy(ctxClass, where, env);
   161             ctxClass.addDependency(field.getClassDeclaration());
   161             ctxClass.addDependency(field.getClassDeclaration());
   162 
   162 
  1119         // the value is not needed.  Similarly, static field dereferences
  1119         // the value is not needed.  Similarly, static field dereferences
  1120         // may cause class initialization, so they mustn't be omitted
  1120         // may cause class initialization, so they mustn't be omitted
  1121         // either.
  1121         // either.
  1122         //
  1122         //
  1123         // However, NullPointerException can't happen and initialization must
  1123         // However, NullPointerException can't happen and initialization must
  1124         // already have occured if you are dotting into 'this'.  So
  1124         // already have occurred if you are dotting into 'this'.  So
  1125         // allow fields of 'this' to be eliminated as a special case.
  1125         // allow fields of 'this' to be eliminated as a special case.
  1126         Expression e = inlineValue(env, ctx);
  1126         Expression e = inlineValue(env, ctx);
  1127         if (e instanceof FieldExpression) {
  1127         if (e instanceof FieldExpression) {
  1128             FieldExpression fe = (FieldExpression) e;
  1128             FieldExpression fe = (FieldExpression) e;
  1129             if ((fe.right != null) && (fe.right.op==THIS))
  1129             if ((fe.right != null) && (fe.right.op==THIS))