src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java

changeset 310
7c154fdc3547
parent 309
664edca41e34
child 323
14b1a8ede954
equal deleted inserted replaced
309:664edca41e34 310:7c154fdc3547
43 43
44 // Tree position. 44 // Tree position.
45 public int pos = -1; 45 public int pos = -1;
46 46
47 // For typecasts, type tests, new (and locals, as start_pc). 47 // For typecasts, type tests, new (and locals, as start_pc).
48 public boolean isValidOffset = false;
48 public int offset = -1; 49 public int offset = -1;
49 50
50 // For locals. arrays same length 51 // For locals. arrays same length
51 public int[] lvarOffset = new int[] { -1 }; 52 public int[] lvarOffset = new int[] { -1 };
52 public int[] lvarLength = new int[] { -1 }; 53 public int[] lvarLength = new int[] { -1 };
175 sb.append(pos); 176 sb.append(pos);
176 177
177 sb.append(']'); 178 sb.append(']');
178 return sb.toString(); 179 return sb.toString();
179 } 180 }
181
182 /**
183 * Indicates whether the target tree of the annotation has been optimized
184 * away from classfile or not.
185 * @return true if the target has not been optimized away
186 */
187 public boolean emitToClassfile() {
188 if (type == TargetType.WILDCARD_BOUND
189 || type == TargetType.WILDCARD_BOUND_GENERIC_OR_ARRAY)
190 return wildcard_position.isValidOffset;
191 else
192 return !type.isLocal() || isValidOffset;
193 }
180 } 194 }

mercurial