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

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-5 / +7 lines)
Lines 2544-2555 Link Here
2544
			return true;
2544
			return true;
2545
		}
2545
		}
2546
2546
2547
		if (one.isVarargs() && two.isVarargs() && oneParamsLength > twoParamsLength) {
2547
		if (one.isVarargs() && two.isVarargs()) {
2548
			// special case when autoboxing makes (int, int...) better than (Object...) but not (int...) or (Integer, int...)
2548
			if (oneParamsLength > twoParamsLength) {
2549
			if (((ArrayBinding) twoParams[twoParamsLength - 1]).elementsType().id != TypeIds.T_JavaLangObject)
2549
				// special case when autoboxing makes (int, int...) better than (Object...) but not (int...) or (Integer, int...)
2550
				return false;
2550
				if (((ArrayBinding) twoParams[twoParamsLength - 1]).elementsType().id != TypeIds.T_JavaLangObject)
2551
					return false;
2552
			}
2551
			// check that each parameter before the vararg parameters are compatible (no autoboxing allowed here)
2553
			// check that each parameter before the vararg parameters are compatible (no autoboxing allowed here)
2552
			for (int i = twoParamsLength - 2; i >= 0; i--)
2554
			for (int i = (oneParamsLength > twoParamsLength ? twoParamsLength : oneParamsLength) - 2; i >= 0; i--)
2553
				if (oneParams[i] != twoParams[i] && !oneParams[i].isCompatibleWith(twoParams[i]))
2555
				if (oneParams[i] != twoParams[i] && !oneParams[i].isCompatibleWith(twoParams[i]))
2554
					return false;
2556
					return false;
2555
			if (parameterCompatibilityLevel(one, twoParams) == NOT_COMPATIBLE
2557
			if (parameterCompatibilityLevel(one, twoParams) == NOT_COMPATIBLE

Return to bug 140168