View | Details | Raw Unified | Return to bug 288920
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (-10 / +27 lines)
Lines 302-308 Link Here
302
			char[] methodDescriptor = binaryType.getEnclosingMethod();
302
			char[] methodDescriptor = binaryType.getEnclosingMethod();
303
			if (methodDescriptor != null) {
303
			if (methodDescriptor != null) {
304
				MethodBinding enclosingMethod = findMethod(methodDescriptor, missingTypeNames);
304
				MethodBinding enclosingMethod = findMethod(methodDescriptor, missingTypeNames);
305
				typeVars = enclosingMethod.typeVariables;
305
				if (enclosingMethod != null) {
306
					typeVars = enclosingMethod.typeVariables;
307
				}
306
			}
308
			}
307
309
308
			// attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
310
			// attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
Lines 681-686 Link Here
681
	TypeBinding[] parameters = Binding.NO_PARAMETERS;
683
	TypeBinding[] parameters = Binding.NO_PARAMETERS;
682
	int numOfParams = 0;
684
	int numOfParams = 0;
683
	char nextChar;
685
	char nextChar;
686
	int paramStart = index;
684
	while ((nextChar = methodDescriptor[++index]) != ')') {
687
	while ((nextChar = methodDescriptor[++index]) != ')') {
685
		if (nextChar != '[') {
688
		if (nextChar != '[') {
686
			numOfParams++;
689
			numOfParams++;
Lines 688-714 Link Here
688
				while ((nextChar = methodDescriptor[++index]) != ';'){/*empty*/}
691
				while ((nextChar = methodDescriptor[++index]) != ';'){/*empty*/}
689
		}
692
		}
690
	}
693
	}
691
692
	int startIndex = 0;
693
	if (numOfParams > 0) {
694
	if (numOfParams > 0) {
694
		parameters = new TypeBinding[numOfParams];
695
		parameters = new TypeBinding[numOfParams];
695
		index = 1;
696
		index = paramStart + 1;
696
		int end = 0;   // first character is always '(' so skip it
697
		int end = paramStart; // first character is always '(' so skip it
697
		for (int i = 0; i < numOfParams; i++) {
698
		for (int i = 0; i < numOfParams; i++) {
698
			while ((nextChar = methodDescriptor[++end]) == '['){/*empty*/}
699
			while ((nextChar = methodDescriptor[++end]) == '['){/*empty*/}
699
			if (nextChar == 'L')
700
			if (nextChar == 'L')
700
				while ((nextChar = methodDescriptor[++end]) != ';'){/*empty*/}
701
				while ((nextChar = methodDescriptor[++end]) != ';'){/*empty*/}
701
702
702
			if (i >= startIndex) {   // skip the synthetic arg if necessary
703
			TypeBinding param = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames);
703
				parameters[i - startIndex] = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames);
704
			if (param instanceof UnresolvedReferenceBinding) {
705
				param = resolveType(param, this.environment, true /* raw conversion */);
704
			}
706
			}
707
			parameters[i] = param;
705
			index = end + 1;
708
			index = end + 1;
706
		}
709
		}
707
	}
710
	}
708
711
709
	return CharOperation.equals(selector, TypeConstants.INIT)
712
	int parameterLength = parameters.length;
710
		? this.enclosingType.getExactConstructor(parameters)
713
	MethodBinding[] methods2 = this.enclosingType.getMethods(selector, parameterLength);
711
		: this.enclosingType.getExactMethod(selector, parameters, null);
714
	// find matching method using parameters
715
	loop: for (int i = 0, max = methods2.length; i < max; i++) {
716
		MethodBinding currentMethod = methods2[i];
717
		TypeBinding[] parameters2 = currentMethod.parameters;
718
		int currentMethodParameterLength = parameters2.length;
719
		if (parameterLength == currentMethodParameterLength) {
720
			for (int j = 0; j < currentMethodParameterLength; j++) {
721
				if (parameters[j] != parameters2[j] && parameters[j].erasure() != parameters2[j].erasure()) {
722
					continue loop;
723
				}
724
			}
725
			return currentMethod;
726
		}
727
	}
728
	return null;
712
}
729
}
713
730
714
/**
731
/**

Return to bug 288920