Lines Matching refs:field

41     MemberDefinition field;
44 // The class from which the field is select ed.
58 public FieldExpression(long where, Expression right, MemberDefinition field) {
59 super(FIELD, where, field.getType(), right);
60 this.id = field.getName();
61 this.field = field;
71 * Return true if the field is being selected from
110 ClassDefinition ctxClass = ctx.field.getClassDefinition();
113 // Is this field expression a non-inner type?
138 MemberDefinition field = rightClass.getInnerClass(env, id);
139 if (field == null) {
144 ClassDefinition innerClass = field.getInnerClass();
147 if (!ctxClass.canAccess(env, field)) {
151 if (field.isProtected()
152 && !ctxClass.protectedAccess(env, field, rty)) {
161 ctxClass.addDependency(field.getClassDeclaration());
166 env.error(where, "class.not.found", e.name, ctx.field);
211 if (env.resolve(where, ctx.field.getClassDefinition(), t)) {
298 // If the field is final and its initializer is a constant expression,
306 if (field.isFinal()) {
307 Expression e = (Expression)field.getValue();
316 //System.out.println("Finding access method for " + field);
317 MemberDefinition af = abase.getAccessMember(env, ctx, field, isQualSuper());
321 //System.out.println("Reading " + field +
323 // If referencing the value of the field, then replace
325 // the field, a call to the update method will be
330 if (field.isStatic()) {
350 if (field.isPrivate()) {
351 ClassDefinition cdef = field.getClassDefinition();
352 ClassDefinition ctxClass = ctx.field.getClassDefinition();
354 // If access from same class as field, then no access
358 // An access method is needed in the class containing the field.
360 } else if (field.isProtected()) {
368 ClassDefinition cdef = field.getClassDefinition();
369 ClassDefinition ctxClass = ctx.field.getClassDefinition();
377 // field. NOTE: The fact that the returned class is 'superBase'
464 long fwhere = ctx.field.getWhere();
465 ClassDefinition fcls = ctx.field.getClassDefinition();
506 if (field != null) {
508 // The field as been pre-set, e.g., as the result of transforming
512 // expressions and field expressions that denote instance and
531 // Nope. Is this field expression a type?
536 ClassDefinition ctxClass = ctx.field.getClassDefinition();
548 ClassDefinition ctxClass = ctx.field.getClassDefinition();
553 // Handle array 'length' field, e.g., 'x.length'.
574 env.error(where, "invalid.field.reference", id, right.type);
582 // reach here. Instead, '<expr>' is stored as the 'outerArg' field
586 // about to do a field selection '<class>.super.<field>'.
613 // occur as the qualifying expression of a field access or a method
630 if (ctx.field.isSynthetic())
651 field = clazz.getVariable(env, id, sourceClass);
653 if (field == null && staticRef && loc != null) {
654 // Is this field expression an inner type?
663 field = clazz.getInnerClass(env, id);
664 if (field != null) {
672 if (field == null) {
673 if ((field = clazz.findAnyMethod(env, id)) != null) {
674 env.error(where, "invalid.field",
675 id, field.getClassDeclaration());
677 env.error(where, "no.such.field", id, clazz);
682 // At this point, we have identified a valid field.
696 type = field.getType();
698 if (!sourceClass.canAccess(env, field)) {
699 env.error(where, "no.field.access",
704 if (staticRef && !field.isStatic()) {
705 // 'Class.field' is not legal when field is not static;
708 // be dynamic access of the form 'this.field'.
709 env.error(where, "no.static.field.access", id, clazz);
716 // Check for invalid access to protected field.
717 if (field.isProtected()
722 && !sourceClass.protectedAccess(env, field, right.type)) {
723 env.error(where, "invalid.protected.field.use",
724 field.getName(), field.getClassDeclaration(),
729 if ((!field.isStatic()) &&
734 if (field.reportDeprecated(env)) {
735 env.error(where, "warn."+"field.is.deprecated",
736 id, field.getClassDefinition());
746 // Find out if the class which contains this field
748 // public or protected field.
750 ClassDefinition declarer = field.getClassDefinition();
756 // field + " declared in class " +
765 // field in ctxClass and set `field' to refer to it.
766 field =
767 MemberDefinition.makeProxyMember(field, clazz, env);
771 sourceClass.addDependency(field.getClassDeclaration());
774 env.error(where, "class.not.found", e.name, ctx.field);
777 env.error(where, "ambig.field",
799 if (field == null) {
800 // Field can legitimately be null if the field name was
802 // no value for 'field' is available.
808 MemberDefinition setter = abase.getUpdateMember(env, ctx, field, isQualSuper());
812 return new FieldUpdater(where, field, base, null, setter);
830 if (field == null) {
831 // Field can legitimately be null if the field name was
833 // no value for 'field' is available.
839 MemberDefinition getter = abase.getAccessMember(env, ctx, field, isQualSuper());
840 MemberDefinition setter = abase.getUpdateMember(env, ctx, field, isQualSuper());
843 return new FieldUpdater(where, field, base, getter, setter);
849 * This field expression is an inner class reference.
855 ClassDefinition inner = field.getInnerClass();
865 ClassDefinition ctxClass = ctx.field.getClassDefinition();
867 if (!ctxClass.canAccess(env, field)) {
870 // id, clazz, ctx.field.getClassDeclaration());
876 if (field.isProtected()
881 && !ctxClass.protectedAccess(env, field, right.type)){
882 env.error(where, "invalid.protected.field.use",
883 field.getName(), field.getClassDeclaration(),
891 env.error(where, "class.not.found", e.name, ctx.field);
894 ctxClass.addDependency(field.getClassDeclaration());
907 boolean hadField = (field != null);
913 // field expression does not denote an assignable location,
914 // e.g., the 'length' field of an array.
920 if (field != null && field.isFinal() && !hadField) {
921 if (field.isBlankFinal()) {
922 if (field.isStatic()) {
930 env.error(where, "bad.qualified.final.assign", field.getName());
936 vset = checkFinalAssign(env, ctx, vset, where, field);
954 // field expression does not denote an assignable location,
955 // e.g., the 'length' field of an array.
959 if (field != null && field.isFinal()) {
966 * There is a simple assignment being made to the given final field.
967 * The field was named either by a simple name or by an almost-simple
981 MemberDefinition field) {
982 if (field.isBlankFinal()
983 && field.getClassDefinition() == ctx.field.getClassDefinition()) {
984 int number = ctx.getFieldNumber(field);
990 Identifier id = field.getName();
995 Identifier id = field.getName();
1005 // Given a class name, look for a static field to cache it.
1029 // ClassDefinition c = ctx.field.getClassDefinition();
1042 // Ignore inherited field. Each top-level class
1103 if ((field != null)
1106 return field.isConstant();
1117 // A field expression may have the side effect of causing
1119 // the value is not needed. Similarly, static field dereferences
1142 if (field == null) {
1146 if (field.isFinal()) {
1147 Expression e = (Expression)field.getValue(env);
1157 if (field.isStatic()) {
1177 if (field.isStatic()) {
1207 ClassDefinition ctxClass = ctx.field.getClassDefinition();
1210 // the field, the field's class, and right's declared type.
1211 if ( ctxClass.permitInlinedAccess(env, field.getClassDeclaration())
1212 && ctxClass.permitInlinedAccess(env, field)) {
1233 if (field.isStatic()) {
1244 if (field == null) {
1247 if (field.isStatic()) {
1248 asm.add(where, opc_getstatic, field);
1250 asm.add(where, opc_getfield, field);
1254 if (field.isStatic()) {
1255 asm.add(where, opc_putstatic, field);
1257 asm.add(where, opc_putfield, field);