Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2018-11-24 06:59:26 -0500
committerJay Arthanareeswaran2019-05-17 05:18:50 -0400
commit3bfcbfdb646353b49a162b1ce4b2d12369297cbd (patch)
tree3545b67bfb4d75a6501f664dfd07e2d26e4cc542
parenta068825c7323c0bdfce75ff65ce829eb7b4bf2e4 (diff)
downloadeclipse.jdt.core-3bfcbfdb646353b49a162b1ce4b2d12369297cbd.tar.gz
eclipse.jdt.core-3bfcbfdb646353b49a162b1ce4b2d12369297cbd.tar.xz
eclipse.jdt.core-3bfcbfdb646353b49a162b1ce4b2d12369297cbd.zip
Bug 541466 - Eclipse APT implementation fails when annotation referencesI20190518-1800I20190517-1800
a class not on the class path Change-Id: Ic80814c9a2cf99dc02cc18ac51225c763d6ae6b8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java30
1 files changed, 18 insertions, 12 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
index 51ed3bf578..db529aa3c4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
@@ -57,19 +57,25 @@ public ElementValuePair[] getElementValuePairs() {
pair.setMethodBinding(methods[0]);
} // else silently leave a null there
Object value = pair.getValue();
- if (value instanceof UnresolvedReferenceBinding) {
- pair.setValue(((UnresolvedReferenceBinding) value).
- resolve(this.env, false));
- // no parameterized types in annotation values
- } else if (value instanceof Object[]) {
- Object[] values = (Object[]) value;
- for (int j = 0; j < values.length; j++) {
- if (values[j] instanceof UnresolvedReferenceBinding) {
- values[j] = ((UnresolvedReferenceBinding) values[j]).resolve(this.env, false);
+ boolean wasToleratingMissingTypeProcessingAnnotations = this.env.mayTolerateMissingType;
+ this.env.mayTolerateMissingType = true; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=360164
+ try {
+ if (value instanceof UnresolvedReferenceBinding) {
+ pair.setValue(((UnresolvedReferenceBinding) value).
+ resolve(this.env, false));
+ // no parameterized types in annotation values
+ } else if (value instanceof Object[]) {
+ Object[] values = (Object[]) value;
+ for (int j = 0; j < values.length; j++) {
+ if (values[j] instanceof UnresolvedReferenceBinding) {
+ values[j] = ((UnresolvedReferenceBinding) values[j]).resolve(this.env, false);
+ }
}
- }
- } // do nothing for UnresolvedAnnotationBinding-s, since their
- // content is only accessed through get* methods
+ } // do nothing for UnresolvedAnnotationBinding-s, since their
+ // content is only accessed through get* methods
+ } finally {
+ this.env.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations;
+ }
}
this.env = null;
}

Back to the top