|
Lines 16-21
Link Here
|
| 16 |
* bug 392862 - [1.8][compiler][null] Evaluate null annotations on array types |
16 |
* bug 392862 - [1.8][compiler][null] Evaluate null annotations on array types |
| 17 |
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for |
17 |
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for |
| 18 |
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) |
18 |
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) |
|
|
19 |
* Bug 409236 - [1.8][compiler] Type annotations on intersection cast types dropped by code generator |
| 19 |
*******************************************************************************/ |
20 |
*******************************************************************************/ |
| 20 |
package org.eclipse.jdt.internal.compiler.ast; |
21 |
package org.eclipse.jdt.internal.compiler.ast; |
| 21 |
|
22 |
|
|
Lines 51-58
static class AnnotationCollector extends ASTVisitor {
Link Here
|
| 51 |
TypeReference typeReference; |
52 |
TypeReference typeReference; |
| 52 |
int targetType; |
53 |
int targetType; |
| 53 |
Annotation[] primaryAnnotations; |
54 |
Annotation[] primaryAnnotations; |
| 54 |
int info = -1; |
55 |
int info = 0; |
| 55 |
int info2 = -1; |
56 |
int info2 = 0; |
| 56 |
LocalVariableBinding localVariable; |
57 |
LocalVariableBinding localVariable; |
| 57 |
Annotation[][] annotationsOnDimensions; |
58 |
Annotation[][] annotationsOnDimensions; |
| 58 |
int dimensions; |
59 |
int dimensions; |
|
Lines 183-194
static class AnnotationCollector extends ASTVisitor {
Link Here
|
| 183 |
case AnnotationTargetTypeConstants.NEW : |
184 |
case AnnotationTargetTypeConstants.NEW : |
| 184 |
case AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE : |
185 |
case AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE : |
| 185 |
case AnnotationTargetTypeConstants.METHOD_REFERENCE : |
186 |
case AnnotationTargetTypeConstants.METHOD_REFERENCE : |
| 186 |
case AnnotationTargetTypeConstants.CAST: |
|
|
| 187 |
annotationContext.info = this.info; |
| 188 |
break; |
| 189 |
case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND : |
| 190 |
case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND : |
| 191 |
annotationContext.info2 = this.info2; |
| 192 |
annotationContext.info = this.info; |
187 |
annotationContext.info = this.info; |
| 193 |
break; |
188 |
break; |
| 194 |
case AnnotationTargetTypeConstants.LOCAL_VARIABLE : |
189 |
case AnnotationTargetTypeConstants.LOCAL_VARIABLE : |
|
Lines 199-204
static class AnnotationCollector extends ASTVisitor {
Link Here
|
| 199 |
case AnnotationTargetTypeConstants.METHOD_INVOCATION_TYPE_ARGUMENT : |
194 |
case AnnotationTargetTypeConstants.METHOD_INVOCATION_TYPE_ARGUMENT : |
| 200 |
case AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT : |
195 |
case AnnotationTargetTypeConstants.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT : |
| 201 |
case AnnotationTargetTypeConstants.METHOD_REFERENCE_TYPE_ARGUMENT : |
196 |
case AnnotationTargetTypeConstants.METHOD_REFERENCE_TYPE_ARGUMENT : |
|
|
197 |
case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND : |
| 198 |
case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND : |
| 199 |
case AnnotationTargetTypeConstants.CAST: |
| 202 |
annotationContext.info2 = this.info2; |
200 |
annotationContext.info2 = this.info2; |
| 203 |
annotationContext.info = this.info; |
201 |
annotationContext.info = this.info; |
| 204 |
break; |
202 |
break; |
|
Lines 225-230
static class AnnotationCollector extends ASTVisitor {
Link Here
|
| 225 |
this.currentWildcard = wildcard; |
223 |
this.currentWildcard = wildcard; |
| 226 |
return true; |
224 |
return true; |
| 227 |
} |
225 |
} |
|
|
226 |
public boolean visit(IntersectionCastTypeReference intersectionCastTypeReference, BlockScope scope) { |
| 227 |
int length = intersectionCastTypeReference.typeReferences == null ? 0 : intersectionCastTypeReference.typeReferences.length; |
| 228 |
for (int i = 0; i < length; i++) { |
| 229 |
this.info2 = i; |
| 230 |
intersectionCastTypeReference.typeReferences[i].traverse(this, scope); |
| 231 |
} |
| 232 |
return false; // iteration was done here, do not repeat in the caller |
| 233 |
} |
| 228 |
public boolean visit(Argument argument, BlockScope scope) { |
234 |
public boolean visit(Argument argument, BlockScope scope) { |
| 229 |
if ((argument.bits & ASTNode.IsUnionType) == 0) { |
235 |
if ((argument.bits & ASTNode.IsUnionType) == 0) { |
| 230 |
return true; |
236 |
return true; |