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

Collapse All | Expand All

(-)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
			}
(-)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
}
(-)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;
(-)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
(-)dom/org/eclipse/jdt/core/dom/TypeBinding.java (-2 / +2 lines)
Lines 228-234 Link Here
228
		try {
228
		try {
229
			if (isClass() || isInterface() || isEnum()) {
229
			if (isClass() || isInterface() || isEnum()) {
230
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
230
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
231
				FieldBinding[] fieldBindings = referenceBinding.fields();
231
				FieldBinding[] fieldBindings = referenceBinding.availableFields(); // resilience
232
				int length = fieldBindings.length;
232
				int length = fieldBindings.length;
233
				if (length != 0) {
233
				if (length != 0) {
234
					IVariableBinding[] newFields = new IVariableBinding[length];
234
					IVariableBinding[] newFields = new IVariableBinding[length];
Lines 263-269 Link Here
263
		try {
263
		try {
264
			if (isClass() || isInterface() || isEnum()) {
264
			if (isClass() || isInterface() || isEnum()) {
265
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
265
				ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
266
				org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.methods();
266
				org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.availableMethods(); // be resilient
267
				int length = internalMethods.length;
267
				int length = internalMethods.length;
268
				if (length != 0) {
268
				if (length != 0) {
269
					int removeSyntheticsCounter = 0;
269
					int removeSyntheticsCounter = 0;
(-)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) {

Return to bug 185306