Lines 18-35
Link Here
|
18 |
|
18 |
|
19 |
public TypeBinding lowerBound; |
19 |
public TypeBinding lowerBound; |
20 |
public WildcardBinding wildcard; |
20 |
public WildcardBinding wildcard; |
|
|
21 |
public int captureID; |
21 |
|
22 |
|
22 |
/* information to compute unique binding key */ |
23 |
/* information to compute unique binding key */ |
23 |
public ReferenceBinding sourceType; |
24 |
public ReferenceBinding sourceType; |
24 |
public int position; |
25 |
public int position; |
25 |
|
26 |
|
26 |
public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position) { |
27 |
public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position, int captureID) { |
27 |
super(TypeConstants.WILDCARD_CAPTURE_NAME, null, 0); |
28 |
super(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX, null, 0); |
28 |
this.wildcard = wildcard; |
29 |
this.wildcard = wildcard; |
29 |
this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public |
30 |
this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public |
30 |
this.fPackage = wildcard.fPackage; |
31 |
this.fPackage = wildcard.fPackage; |
31 |
this.sourceType = sourceType; |
32 |
this.sourceType = sourceType; |
32 |
this.position = position; |
33 |
this.position = position; |
|
|
34 |
this.captureID = captureID; |
33 |
} |
35 |
} |
34 |
|
36 |
|
35 |
/* |
37 |
/* |
Lines 54-61
Link Here
|
54 |
} |
56 |
} |
55 |
|
57 |
|
56 |
public String debugName() { |
58 |
public String debugName() { |
|
|
59 |
|
57 |
if (this.wildcard != null) { |
60 |
if (this.wildcard != null) { |
58 |
return String.valueOf(TypeConstants.WILDCARD_CAPTURE_NAME) + this.wildcard.debugName(); |
61 |
StringBuffer buffer = new StringBuffer(10); |
|
|
62 |
buffer |
63 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) |
64 |
.append(this.captureID) |
65 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) |
66 |
.append(this.wildcard.debugName()); |
67 |
return buffer.toString(); |
59 |
} |
68 |
} |
60 |
return super.debugName(); |
69 |
return super.debugName(); |
61 |
} |
70 |
} |
Lines 156-176
Link Here
|
156 |
|
165 |
|
157 |
public char[] readableName() { |
166 |
public char[] readableName() { |
158 |
if (this.wildcard != null) { |
167 |
if (this.wildcard != null) { |
159 |
return CharOperation.concat(TypeConstants.WILDCARD_CAPTURE_NAME, this.wildcard.readableName()); |
168 |
StringBuffer buffer = new StringBuffer(10); |
|
|
169 |
buffer |
170 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) |
171 |
.append(this.captureID) |
172 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) |
173 |
.append(this.wildcard.readableName()); |
174 |
int length = buffer.length(); |
175 |
char[] name = new char[length]; |
176 |
buffer.getChars(0, length, name, 0); |
177 |
return name; |
160 |
} |
178 |
} |
161 |
return super.readableName(); |
179 |
return super.readableName(); |
162 |
} |
180 |
} |
163 |
|
181 |
|
164 |
public char[] shortReadableName() { |
182 |
public char[] shortReadableName() { |
165 |
if (this.wildcard != null) { |
183 |
if (this.wildcard != null) { |
166 |
return CharOperation.concat(TypeConstants.WILDCARD_CAPTURE_NAME, this.wildcard.shortReadableName()); |
184 |
StringBuffer buffer = new StringBuffer(10); |
|
|
185 |
buffer |
186 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) |
187 |
.append(this.captureID) |
188 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) |
189 |
.append(this.wildcard.shortReadableName()); |
190 |
int length = buffer.length(); |
191 |
char[] name = new char[length]; |
192 |
buffer.getChars(0, length, name, 0); |
193 |
return name; |
167 |
} |
194 |
} |
168 |
return super.shortReadableName(); |
195 |
return super.shortReadableName(); |
169 |
} |
196 |
} |
170 |
|
197 |
|
171 |
public String toString() { |
198 |
public String toString() { |
172 |
if (this.wildcard != null) { |
199 |
if (this.wildcard != null) { |
173 |
return String.valueOf(TypeConstants.WILDCARD_CAPTURE_NAME) + this.wildcard.toString(); |
200 |
StringBuffer buffer = new StringBuffer(10); |
|
|
201 |
buffer |
202 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) |
203 |
.append(this.captureID) |
204 |
.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) |
205 |
.append(this.wildcard); |
206 |
return buffer.toString(); |
174 |
} |
207 |
} |
175 |
return super.toString(); |
208 |
return super.toString(); |
176 |
} |
209 |
} |