|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2005, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2011 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 31-36
Link Here
|
| 31 |
public ReferenceBinding[] memberTypes; |
31 |
public ReferenceBinding[] memberTypes; |
| 32 |
public MethodBinding[] methods; |
32 |
public MethodBinding[] methods; |
| 33 |
private ReferenceBinding enclosingType; |
33 |
private ReferenceBinding enclosingType; |
|
|
34 |
private TypeBinding[] expectedArgumentTypes; |
| 34 |
|
35 |
|
| 35 |
public ParameterizedTypeBinding(ReferenceBinding type, TypeBinding[] arguments, ReferenceBinding enclosingType, LookupEnvironment environment){ |
36 |
public ParameterizedTypeBinding(ReferenceBinding type, TypeBinding[] arguments, ReferenceBinding enclosingType, LookupEnvironment environment){ |
| 36 |
this.environment = environment; |
37 |
this.environment = environment; |
|
Lines 451-457
Link Here
|
| 451 |
public MethodBinding getExactConstructor(TypeBinding[] argumentTypes) { |
452 |
public MethodBinding getExactConstructor(TypeBinding[] argumentTypes) { |
| 452 |
int argCount = argumentTypes.length; |
453 |
int argCount = argumentTypes.length; |
| 453 |
MethodBinding match = null; |
454 |
MethodBinding match = null; |
| 454 |
|
455 |
this.expectedArgumentTypes = argumentTypes; |
| 455 |
if ((this.tagBits & TagBits.AreMethodsComplete) != 0) { // have resolved all arg types & return type of the methods |
456 |
if ((this.tagBits & TagBits.AreMethodsComplete) != 0) { // have resolved all arg types & return type of the methods |
| 456 |
long range; |
457 |
long range; |
| 457 |
if ((range = ReferenceBinding.binarySearch(TypeConstants.INIT, this.methods)) >= 0) { |
458 |
if ((range = ReferenceBinding.binarySearch(TypeConstants.INIT, this.methods)) >= 0) { |
|
Lines 955-960
Link Here
|
| 955 |
// lazy init, since cannot do so during binding creation if during supertype connection |
956 |
// lazy init, since cannot do so during binding creation if during supertype connection |
| 956 |
if (currentType.arguments == null) |
957 |
if (currentType.arguments == null) |
| 957 |
currentType.initializeArguments(); // only for raw types |
958 |
currentType.initializeArguments(); // only for raw types |
|
|
959 |
else if (currentType.arguments.length == 0) { // diamond case |
| 960 |
// this.expectedArgumentTypes should have the argument list |
| 961 |
if (currentType.expectedArgumentTypes != null && currentType.expectedArgumentTypes.length != 0) { |
| 962 |
return currentType.expectedArgumentTypes[originalVariable.rank]; |
| 963 |
} |
| 964 |
return originalVariable; |
| 965 |
} |
| 958 |
if (currentType.arguments != null) |
966 |
if (currentType.arguments != null) |
| 959 |
return currentType.arguments[originalVariable.rank]; |
967 |
return currentType.arguments[originalVariable.rank]; |
| 960 |
} |
968 |
} |