View | Details | Raw Unified | Return to bug 185306 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (+7 lines)
Lines 187-192 Link Here
187
	}	
187
	}	
188
}
188
}
189
189
190
/**
191
 * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#availableMethods()
192
 */
190
public FieldBinding[] availableFields() {
193
public FieldBinding[] availableFields() {
191
	if ((this.tagBits & TagBits.AreFieldsComplete) != 0)
194
	if ((this.tagBits & TagBits.AreFieldsComplete) != 0)
192
		return fields;
195
		return fields;
Lines 212-217 Link Here
212
		System.arraycopy(availableFields, 0, availableFields = new FieldBinding[count], 0, count);
215
		System.arraycopy(availableFields, 0, availableFields = new FieldBinding[count], 0, count);
213
	return availableFields;
216
	return availableFields;
214
}
217
}
218
219
/**
220
 * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#availableMethods()
221
 */
215
public MethodBinding[] availableMethods() {
222
public MethodBinding[] availableMethods() {
216
	if ((this.tagBits & TagBits.AreMethodsComplete) != 0)
223
	if ((this.tagBits & TagBits.AreMethodsComplete) != 0)
217
		return methods;
224
		return methods;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java (+7 lines)
Lines 160-168 Link Here
160
	Arrays.sort(sortedMethods, left, right, METHOD_COMPARATOR);
160
	Arrays.sort(sortedMethods, left, right, METHOD_COMPARATOR);
161
}
161
}
162
162
163
/**
164
 * Return the array of resolvable fields (resilience)
165
 */
163
public FieldBinding[] availableFields() {
166
public FieldBinding[] availableFields() {
164
	return fields();
167
	return fields();
165
}
168
}
169
170
/**
171
 * Return the array of resolvable methods (resilience)
172
 */
166
public MethodBinding[] availableMethods() {
173
public MethodBinding[] availableMethods() {
167
	return methods();
174
	return methods();
168
}
175
}
(-)search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java (-2 / +2 lines)
Lines 69-75 Link Here
69
				// filter out element not in hierarchy scope
69
				// filter out element not in hierarchy scope
70
				if (!locator.typeInHierarchy(binding)) return;
70
				if (!locator.typeInHierarchy(binding)) return;
71
71
72
				MethodBinding[] methods = binding.methods();
72
				MethodBinding[] methods = binding.availableMethods(); // resilience
73
				for (int i = 0, l = methods.length; i < l; i++) {
73
				for (int i = 0, l = methods.length; i < l; i++) {
74
					MethodBinding method = methods[i];
74
					MethodBinding method = methods[i];
75
					if (locator.patternLocator.resolveLevel(method) == PatternLocator.ACCURATE_MATCH) {
75
					if (locator.patternLocator.resolveLevel(method) == PatternLocator.ACCURATE_MATCH) {
Lines 82-88 Link Here
82
					}
82
					}
83
				}
83
				}
84
84
85
				FieldBinding[] fields = binding.fields();
85
				FieldBinding[] fields = binding.availableFields();
86
				for (int i = 0, l = fields.length; i < l; i++) {
86
				for (int i = 0, l = fields.length; i < l; i++) {
87
					FieldBinding field = fields[i];
87
					FieldBinding field = fields[i];
88
					if (locator.patternLocator.resolveLevel(field) == PatternLocator.ACCURATE_MATCH) {
88
					if (locator.patternLocator.resolveLevel(field) == PatternLocator.ACCURATE_MATCH) {
(-)dom/org/eclipse/jdt/core/dom/TypeBinding.java (-2 / +2 lines)
Lines 230-236 Link Here
230
		try {
230
		try {
231
			if (isClass() || isInterface() || isEnum()) {
231
			if (isClass() || isInterface() || isEnum()) {
232
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
232
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
233
				FieldBinding[] fieldBindings = referenceBinding.fields();
233
				FieldBinding[] fieldBindings = referenceBinding.availableFields(); // resilience
234
				int length = fieldBindings.length;
234
				int length = fieldBindings.length;
235
				if (length != 0) {
235
				if (length != 0) {
236
					IVariableBinding[] newFields = new IVariableBinding[length];
236
					IVariableBinding[] newFields = new IVariableBinding[length];
Lines 265-271 Link Here
265
		try {
265
		try {
266
			if (isClass() || isInterface() || isEnum()) {
266
			if (isClass() || isInterface() || isEnum()) {
267
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
267
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
268
				org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.methods();
268
				org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.availableMethods(); // be resilient
269
				int length = internalMethods.length;
269
				int length = internalMethods.length;
270
				if (length != 0) {
270
				if (length != 0) {
271
					int removeSyntheticsCounter = 0;
271
					int removeSyntheticsCounter = 0;
(-)dom/org/eclipse/jdt/core/dom/ITypeBinding.java (-9 / +16 lines)
Lines 106-118 Link Here
106
106
107
	/**
107
	/**
108
	 * Returns a list of bindings representing all the fields declared
108
	 * Returns a list of bindings representing all the fields declared
109
	 * as members of this class, interface, or enum type. These include public,
109
	 * as members of this class, interface, or enum type.
110
	 * protected, default (package-private) access, and private fields declared
110
	 * 
111
	 * by the class, but excludes inherited fields. Synthetic fields may or
111
	 * <p>These include public, protected, default (package-private) access,
112
	 * may not be included.
112
	 * and private fields declared by the class, but excludes inherited fields.
113
	 * Returns an empty list if the class, interface, or enum declares no fields,
113
	 * Synthetic fields may or may not be included. Fields from binary types that
114
	 * and for other kinds of type bindings that do not directly have members.
114
	 * reference unresolvable types may not be included.</p>
115
	 * The resulting bindings are in no particular order.
115
	 *
116
	 * <p>Returns an empty list if the class, interface, or enum declares no fields,
117
	 * and for other kinds of type bindings that do not directly have members.</p>
118
	 *
119
	 * <p>The resulting bindings are in no particular order.</p>
116
	 *
120
	 *
117
	 * @return the list of bindings for the field members of this type,
121
	 * @return the list of bindings for the field members of this type,
118
	 *   or the empty list if this type does not have field members
122
	 *   or the empty list if this type does not have field members
Lines 122-133 Link Here
122
	/**
126
	/**
123
	 * Returns a list of method bindings representing all the methods and
127
	 * Returns a list of method bindings representing all the methods and
124
	 * constructors declared for this class, interface, enum, or annotation
128
	 * constructors declared for this class, interface, enum, or annotation
125
	 * type. These include public, protected, default (package-private) access,
129
	 * type.
130
	 * <p>These include public, protected, default (package-private) access,
126
	 * and private methods Synthetic methods and constructors may or may not be
131
	 * and private methods Synthetic methods and constructors may or may not be
127
	 * included. Returns an empty list if the class, interface, or enum,
132
	 * included. Returns an empty list if the class, interface, or enum,
128
	 * type declares no methods or constructors, if the annotation type declares
133
	 * type declares no methods or constructors, if the annotation type declares
129
	 * no members, or if this type binding represents some other kind of type
134
	 * no members, or if this type binding represents some other kind of type
130
	 * binding. The resulting bindings are in no particular order.
135
	 * binding. Methods from binary types that reference unresolvable types may
136
	 * not be included.</p>
137
	 * <p>The resulting bindings are in no particular order.</p>
131
	 *
138
	 *
132
	 * @return the list of method bindings for the methods and constructors
139
	 * @return the list of method bindings for the methods and constructors
133
	 *   declared by this class, interface, enum type, or annotation type,
140
	 *   declared by this class, interface, enum type, or annotation type,
(-)dom/org/eclipse/jdt/core/dom/AnnotationBinding.java (-1 / +1 lines)
Lines 57-63 Link Here
57
		IMemberValuePairBinding[] pairs = getDeclaredMemberValuePairs();
57
		IMemberValuePairBinding[] pairs = getDeclaredMemberValuePairs();
58
		ReferenceBinding typeBinding = this.internalAnnotation.getAnnotationType();
58
		ReferenceBinding typeBinding = this.internalAnnotation.getAnnotationType();
59
		if (typeBinding == null) return pairs;
59
		if (typeBinding == null) return pairs;
60
		MethodBinding[] methods = typeBinding.methods();
60
		MethodBinding[] methods = typeBinding.availableMethods(); // resilience
61
		int methodLength = methods == null ? 0 : methods.length;
61
		int methodLength = methods == null ? 0 : methods.length;
62
		if (methodLength == 0) return pairs;
62
		if (methodLength == 0) return pairs;
63
63
(-)model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java (-3 / +3 lines)
Lines 192-198 Link Here
192
	}
192
	}
193
193
194
	public void consumeField(char[] fieldName) {
194
	public void consumeField(char[] fieldName) {
195
		FieldBinding[] fields = ((ReferenceBinding) this.typeBinding).fields();
195
		FieldBinding[] fields = ((ReferenceBinding) this.typeBinding).availableFields(); // resilience
196
	 	for (int i = 0, length = fields.length; i < length; i++) {
196
	 	for (int i = 0, length = fields.length; i < length; i++) {
197
			FieldBinding field = fields[i];
197
			FieldBinding field = fields[i];
198
			if (CharOperation.equals(fieldName, field.name)) {
198
			if (CharOperation.equals(fieldName, field.name)) {
Lines 238-244 Link Here
238
	}
238
	}
239
239
240
	public void consumeMethod(char[] selector, char[] signature) {
240
	public void consumeMethod(char[] selector, char[] signature) {
241
		MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).methods();
241
		MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).availableMethods(); // resilience
242
	 	for (int i = 0, methodLength = methods.length; i < methodLength; i++) {
242
	 	for (int i = 0, methodLength = methods.length; i < methodLength; i++) {
243
			MethodBinding method = methods[i];
243
			MethodBinding method = methods[i];
244
			if (CharOperation.equals(selector, method.selector) || (selector.length == 0 && method.isConstructor())) {
244
			if (CharOperation.equals(selector, method.selector) || (selector.length == 0 && method.isConstructor())) {
Lines 339-345 Link Here
339
	public void consumeTypeVariable(char[] position, char[] typeVariableName) {
339
	public void consumeTypeVariable(char[] position, char[] typeVariableName) {
340
		if (position.length > 0) {
340
		if (position.length > 0) {
341
			int pos = Integer.parseInt(new String(position));
341
			int pos = Integer.parseInt(new String(position));
342
			MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).methods();
342
			MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).availableMethods(); // resilience
343
			if (methods != null && pos < methods.length) {
343
			if (methods != null && pos < methods.length) {
344
				this.methodBinding = methods[pos];
344
				this.methodBinding = methods[pos];
345
			}
345
			}

Return to bug 185306