diff options
Diffstat (limited to 'org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java')
-rw-r--r-- | org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java index 3a77881df..1f7426124 100644 --- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java +++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java @@ -13,7 +13,7 @@ * Jesper S Moller <jesper@selskabet.org> - Contributions for * bug 378674 - "The method can be declared as static" is wrong * Stephan Herrmann - Contribution for - * Bug 424167 - [1.8] Fully integrate type inference with overload resolution + * Bug 424167 - [1.8] Fully integrate type inference with overload resolution *******************************************************************************/ package org.eclipse.jdt.internal.eval; @@ -133,7 +133,7 @@ public final boolean canBeSeenByForCodeSnippet(FieldBinding fieldBinding, TypeBi TypeBinding originalDeclaringClass = fieldBinding.declaringClass .original(); do { if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002 - if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true; + if (TypeBinding.equalsEquals(originalDeclaringClass, type.erasure().original())) return true; } else { if (TypeBinding.equalsEquals(originalDeclaringClass, type.original())) return true; } @@ -229,9 +229,9 @@ public final boolean canBeSeenByForCodeSnippet(ReferenceBinding referenceBinding if (TypeBinding.equalsEquals(receiverType, referenceBinding)) return true; if (referenceBinding.isProtected()) { - // answer true if the receiver (or its enclosing type) is the superclass + // answer true if the receiver (or its enclosing type) is the superclass // of the receiverType or in the same package - return receiverType.fPackage == referenceBinding.fPackage + return receiverType.fPackage == referenceBinding.fPackage || referenceBinding.isSuperclassOf(receiverType) || referenceBinding.enclosingType().isSuperclassOf(receiverType); // protected types always have an enclosing one } @@ -425,7 +425,7 @@ public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] select Only if all of the input is consumed is the type answered All other conditions are errors, and a problem binding is returned. - + NOTE: If a problem binding is returned, senders should extract the compound name from the binding & not assume the problem applies to the entire compoundName. @@ -466,7 +466,7 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca if (binding instanceof ReferenceBinding) { if (!binding.isValidBinding()) return new ProblemReferenceBinding( - CharOperation.subarray(compoundName, 0, currentIndex), + CharOperation.subarray(compoundName, 0, currentIndex), (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), binding.problemId()); if (!this.canBeSeenByForCodeSnippet((ReferenceBinding) binding, receiverType)) @@ -488,8 +488,8 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca if ((binding = findFieldForCodeSnippet(typeBinding, nextName, invocationSite)) != null) { if (!binding.isValidBinding()) { return new ProblemFieldBinding( - (FieldBinding)binding, - ((FieldBinding)binding).declaringClass, + (FieldBinding)binding, + ((FieldBinding)binding).declaringClass, CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'), binding.problemId()); } @@ -499,7 +499,7 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca return new ProblemBinding(CharOperation.subarray(compoundName, 0, currentIndex), typeBinding, ProblemReasons.NotFound); if (!binding.isValidBinding()) return new ProblemReferenceBinding( - CharOperation.subarray(compoundName, 0, currentIndex), + CharOperation.subarray(compoundName, 0, currentIndex), (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), binding.problemId()); } @@ -508,12 +508,12 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca FieldBinding field = (FieldBinding) binding; if (!field.isStatic()) { return new ProblemFieldBinding( - field, + field, field.declaringClass, CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'), ProblemReasons.NonStaticReferenceInStaticContext); } - // Since a qualified reference must be for a static member, it won't affect static-ness of the enclosing method, + // Since a qualified reference must be for a static member, it won't affect static-ness of the enclosing method, // so we don't have to call resetEnclosingMethodStaticFlag() in this case return binding; } @@ -528,7 +528,7 @@ public Binding getBinding(char[][] compoundName, int mask, InvocationSite invoca Answer the constructor binding that corresponds to receiverType, argumentTypes. - InvocationSite implements + InvocationSite implements isSuperAccess(); this is used to determine if the discovered constructor is visible. If no visible constructor is discovered, an error binding is answered. @@ -595,7 +595,7 @@ public FieldBinding getFieldForCodeSnippet(TypeBinding receiverType, char[] fiel Answer the method binding that corresponds to selector, argumentTypes. Start the lookup at the enclosing type of the receiver. - InvocationSite implements + InvocationSite implements isSuperAccess(); this is used to determine if the discovered method is visible. setDepth(int); this is used to record the depth of the discovered method relative to the enclosing type of the receiver. (If the method is defined |