Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66592 Details for
Bug 185306
Help with fields and methods on binary super types with unresolved references
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_185306.txt (text/plain), 10.29 KB, created by
Olivier Thomann
on 2007-05-09 20:19:25 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-05-09 20:19:25 EDT
Size:
10.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java,v >retrieving revision 1.104 >diff -u -r1.104 BinaryTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 10 Apr 2007 19:03:10 -0000 1.104 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 10 May 2007 00:15:36 -0000 >@@ -187,6 +187,9 @@ > } > } > >+/** >+ * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#availableMethods() >+ */ > public FieldBinding[] availableFields() { > if ((this.tagBits & TagBits.AreFieldsComplete) != 0) > return fields; >@@ -212,6 +215,10 @@ > System.arraycopy(availableFields, 0, availableFields = new FieldBinding[count], 0, count); > return availableFields; > } >+ >+/** >+ * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#availableMethods() >+ */ > public MethodBinding[] availableMethods() { > if ((this.tagBits & TagBits.AreMethodsComplete) != 0) > return methods; >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java,v >retrieving revision 1.110 >diff -u -r1.110 ReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 20 Apr 2007 23:32:43 -0000 1.110 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 10 May 2007 00:15:38 -0000 >@@ -160,9 +160,16 @@ > Arrays.sort(sortedMethods, left, right, METHOD_COMPARATOR); > } > >+/** >+ * Return the array of resolvable fields (resilience) >+ */ > public FieldBinding[] availableFields() { > return fields(); > } >+ >+/** >+ * Return the array of resolvable methods (resilience) >+ */ > public MethodBinding[] availableMethods() { > return methods(); > } >Index: search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java,v >retrieving revision 1.30 >diff -u -r1.30 ClassFileMatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java 6 Dec 2006 18:29:18 -0000 1.30 >+++ search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java 10 May 2007 00:15:39 -0000 >@@ -69,7 +69,7 @@ > // filter out element not in hierarchy scope > if (!locator.typeInHierarchy(binding)) return; > >- MethodBinding[] methods = binding.methods(); >+ MethodBinding[] methods = binding.availableMethods(); // resilience > for (int i = 0, l = methods.length; i < l; i++) { > MethodBinding method = methods[i]; > if (locator.patternLocator.resolveLevel(method) == PatternLocator.ACCURATE_MATCH) { >@@ -82,7 +82,7 @@ > } > } > >- FieldBinding[] fields = binding.fields(); >+ FieldBinding[] fields = binding.availableFields(); > for (int i = 0, l = fields.length; i < l; i++) { > FieldBinding field = fields[i]; > if (locator.patternLocator.resolveLevel(field) == PatternLocator.ACCURATE_MATCH) { >Index: dom/org/eclipse/jdt/core/dom/TypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java,v >retrieving revision 1.131 >diff -u -r1.131 TypeBinding.java >--- dom/org/eclipse/jdt/core/dom/TypeBinding.java 9 May 2007 18:49:23 -0000 1.131 >+++ dom/org/eclipse/jdt/core/dom/TypeBinding.java 10 May 2007 00:15:39 -0000 >@@ -230,7 +230,7 @@ > try { > if (isClass() || isInterface() || isEnum()) { > ReferenceBinding referenceBinding = (ReferenceBinding) this.binding; >- FieldBinding[] fieldBindings = referenceBinding.fields(); >+ FieldBinding[] fieldBindings = referenceBinding.availableFields(); // resilience > int length = fieldBindings.length; > if (length != 0) { > IVariableBinding[] newFields = new IVariableBinding[length]; >@@ -265,7 +265,7 @@ > try { > if (isClass() || isInterface() || isEnum()) { > ReferenceBinding referenceBinding = (ReferenceBinding) this.binding; >- org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.methods(); >+ org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.availableMethods(); // be resilient > int length = internalMethods.length; > if (length != 0) { > int removeSyntheticsCounter = 0; >Index: dom/org/eclipse/jdt/core/dom/ITypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java,v >retrieving revision 1.67 >diff -u -r1.67 ITypeBinding.java >--- dom/org/eclipse/jdt/core/dom/ITypeBinding.java 24 Apr 2007 15:25:17 -0000 1.67 >+++ dom/org/eclipse/jdt/core/dom/ITypeBinding.java 10 May 2007 00:15:38 -0000 >@@ -106,13 +106,17 @@ > > /** > * Returns a list of bindings representing all the fields declared >- * as members of this class, interface, or enum type. These include public, >- * protected, default (package-private) access, and private fields declared >- * by the class, but excludes inherited fields. Synthetic fields may or >- * may not be included. >- * Returns an empty list if the class, interface, or enum declares no fields, >- * and for other kinds of type bindings that do not directly have members. >- * The resulting bindings are in no particular order. >+ * as members of this class, interface, or enum type. >+ * >+ * <p>These include public, protected, default (package-private) access, >+ * and private fields declared by the class, but excludes inherited fields. >+ * Synthetic fields may or may not be included. Fields from binary types that >+ * reference unresolvable types may not be included.</p> >+ * >+ * <p>Returns an empty list if the class, interface, or enum declares no fields, >+ * and for other kinds of type bindings that do not directly have members.</p> >+ * >+ * <p>The resulting bindings are in no particular order.</p> > * > * @return the list of bindings for the field members of this type, > * or the empty list if this type does not have field members >@@ -122,12 +126,15 @@ > /** > * Returns a list of method bindings representing all the methods and > * constructors declared for this class, interface, enum, or annotation >- * type. These include public, protected, default (package-private) access, >+ * type. >+ * <p>These include public, protected, default (package-private) access, > * and private methods Synthetic methods and constructors may or may not be > * included. Returns an empty list if the class, interface, or enum, > * type declares no methods or constructors, if the annotation type declares > * no members, or if this type binding represents some other kind of type >- * binding. The resulting bindings are in no particular order. >+ * binding. Methods from binary types that reference unresolvable types may >+ * not be included.</p> >+ * <p>The resulting bindings are in no particular order.</p> > * > * @return the list of method bindings for the methods and constructors > * declared by this class, interface, enum type, or annotation type, >Index: dom/org/eclipse/jdt/core/dom/AnnotationBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java,v >retrieving revision 1.3 >diff -u -r1.3 AnnotationBinding.java >--- dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 26 Mar 2007 17:30:24 -0000 1.3 >+++ dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 10 May 2007 00:15:38 -0000 >@@ -57,7 +57,7 @@ > IMemberValuePairBinding[] pairs = getDeclaredMemberValuePairs(); > ReferenceBinding typeBinding = this.internalAnnotation.getAnnotationType(); > if (typeBinding == null) return pairs; >- MethodBinding[] methods = typeBinding.methods(); >+ MethodBinding[] methods = typeBinding.availableMethods(); // resilience > int methodLength = methods == null ? 0 : methods.length; > if (methodLength == 0) return pairs; > >Index: model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java,v >retrieving revision 1.39 >diff -u -r1.39 BindingKeyResolver.java >--- model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java 14 Mar 2007 09:32:47 -0000 1.39 >+++ model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java 10 May 2007 00:15:39 -0000 >@@ -192,7 +192,7 @@ > } > > public void consumeField(char[] fieldName) { >- FieldBinding[] fields = ((ReferenceBinding) this.typeBinding).fields(); >+ FieldBinding[] fields = ((ReferenceBinding) this.typeBinding).availableFields(); // resilience > for (int i = 0, length = fields.length; i < length; i++) { > FieldBinding field = fields[i]; > if (CharOperation.equals(fieldName, field.name)) { >@@ -238,7 +238,7 @@ > } > > public void consumeMethod(char[] selector, char[] signature) { >- MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).methods(); >+ MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).availableMethods(); // resilience > for (int i = 0, methodLength = methods.length; i < methodLength; i++) { > MethodBinding method = methods[i]; > if (CharOperation.equals(selector, method.selector) || (selector.length == 0 && method.isConstructor())) { >@@ -339,7 +339,7 @@ > public void consumeTypeVariable(char[] position, char[] typeVariableName) { > if (position.length > 0) { > int pos = Integer.parseInt(new String(position)); >- MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).methods(); >+ MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).availableMethods(); // resilience > if (methods != null && pos < methods.length) { > this.methodBinding = methods[pos]; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185306
:
65740
|
65799
| 66592