45592
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 73fc5a2..7358960 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -54,7 +54,9 @@
</ul>
<h3>Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45520">45520</a>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45592">45592</a>
+NPE while searching a method references in jdt-core
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45520">45520</a>
Potential NPE
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45518">45518</a>
Search has to find references put in javadoc comments
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMessageSend.java
index f37601e..7f03bd9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMessageSend.java
@@ -30,6 +30,13 @@
this.arguments = arguments;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#isSuperAccess()
+ */
+ public boolean isSuperAccess() {
+ return false;
+ }
+
public StringBuffer printExpression(int indent, StringBuffer output){
if (receiver != null) {
@@ -52,7 +59,9 @@
constant = NotAConstant;
if (this.receiver instanceof CastExpression) this.receiver.bits |= IgnoreNeedForCastCheckMASK; // will check later on
if (this.receiver == null) {
- this.receiverType = scope.enclosingSourceType();
+ SourceTypeBinding sourceTypeBinding = scope.enclosingSourceType();
+ this.receiverType = sourceTypeBinding;
+ this.receiver = new AnnotationQualifiedTypeReference(sourceTypeBinding.compoundName, new long[sourceTypeBinding.compoundName.length], 0, 0);
}
else {
this.receiverType = receiver.resolveType(scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
index cf9c4c8..0f9fcf9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
@@ -789,34 +789,6 @@
/* API
*
- * Answer the field binding that corresponds to fieldName.
- * Start the lookup at the receiverType.
- * InvocationSite implements
- * isSuperAccess(); this is used to determine if the discovered field is visible.
- * Only fields defined by the receiverType or its supertypes are answered;
- * a field of an enclosing type will not be found using this API.
- *
- * If no visible field is discovered, an error binding is answered.
- */
- public FieldBinding getField(
- TypeBinding receiverType,
- char[] fieldName,
- InvocationSite invocationSite) {
-
- FieldBinding field = findField(receiverType, fieldName, invocationSite, true /*resolve*/);
- if (field == null)
- return new ProblemFieldBinding(
- receiverType instanceof ReferenceBinding
- ? (ReferenceBinding) receiverType
- : null,
- fieldName,
- NotFound);
- else
- return field;
- }
-
- /* API
- *
* Answer the method binding that corresponds to selector, argumentTypes.
* Start the lookup at the enclosing type of the receiver.
* InvocationSite implements
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index 75753f8..b8b702f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -1672,4 +1672,18 @@
}
return methodBinding;
}
+
+ public FieldBinding getField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) {
+
+ FieldBinding field = findField(receiverType, fieldName, invocationSite, true /*resolve*/);
+ if (field == null)
+ return new ProblemFieldBinding(
+ receiverType instanceof ReferenceBinding
+ ? (ReferenceBinding) receiverType
+ : null,
+ fieldName,
+ NotFound);
+ else
+ return field;
+ }
}