Lines 1369-1374
Link Here
|
1369 |
} |
1369 |
} |
1370 |
} |
1370 |
} |
1371 |
public void deprecatedType(TypeBinding type, ASTNode location) { |
1371 |
public void deprecatedType(TypeBinding type, ASTNode location) { |
|
|
1372 |
deprecatedType(type, location, Integer.MAX_VALUE); |
1373 |
} |
1374 |
// The argument 'index' makes sure that we demarcate partial types correctly while marking off |
1375 |
// a deprecated type in a qualified reference (see bug 292510) |
1376 |
public void deprecatedType(TypeBinding type, ASTNode location, int index) { |
1372 |
if (location == null) return; // 1G828DN - no type ref for synthetic arguments |
1377 |
if (location == null) return; // 1G828DN - no type ref for synthetic arguments |
1373 |
int severity = computeSeverity(IProblem.UsingDeprecatedType); |
1378 |
int severity = computeSeverity(IProblem.UsingDeprecatedType); |
1374 |
if (severity == ProblemSeverities.Ignore) return; |
1379 |
if (severity == ProblemSeverities.Ignore) return; |
Lines 1379-1385
Link Here
|
1379 |
new String[] {new String(type.shortReadableName())}, |
1384 |
new String[] {new String(type.shortReadableName())}, |
1380 |
severity, |
1385 |
severity, |
1381 |
location.sourceStart, |
1386 |
location.sourceStart, |
1382 |
nodeSourceEnd(null, location)); |
1387 |
nodeSourceEnd(null, location, index)); |
1383 |
} |
1388 |
} |
1384 |
public void disallowedTargetForAnnotation(Annotation annotation) { |
1389 |
public void disallowedTargetForAnnotation(Annotation annotation) { |
1385 |
this.handle( |
1390 |
this.handle( |
Lines 2651-2656
Link Here
|
2651 |
sourceEnd); |
2656 |
sourceEnd); |
2652 |
} |
2657 |
} |
2653 |
public void incorrectArityForParameterizedType(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { |
2658 |
public void incorrectArityForParameterizedType(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { |
|
|
2659 |
incorrectArityForParameterizedType(location, type, argumentTypes, Integer.MAX_VALUE); |
2660 |
} |
2661 |
public void incorrectArityForParameterizedType(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes, int index) { |
2654 |
if (location == null) { |
2662 |
if (location == null) { |
2655 |
this.handle( |
2663 |
this.handle( |
2656 |
IProblem.IncorrectArityForParameterizedType, |
2664 |
IProblem.IncorrectArityForParameterizedType, |
Lines 2666-2672
Link Here
|
2666 |
new String[] {new String(type.readableName()), typesAsString(false, argumentTypes, false)}, |
2674 |
new String[] {new String(type.readableName()), typesAsString(false, argumentTypes, false)}, |
2667 |
new String[] {new String(type.shortReadableName()), typesAsString(false, argumentTypes, true)}, |
2675 |
new String[] {new String(type.shortReadableName()), typesAsString(false, argumentTypes, true)}, |
2668 |
location.sourceStart, |
2676 |
location.sourceStart, |
2669 |
location.sourceEnd); |
2677 |
nodeSourceEnd(null, location, index)); |
2670 |
} |
2678 |
} |
2671 |
public void incorrectLocationForNonEmptyDimension(ArrayAllocationExpression expression, int index) { |
2679 |
public void incorrectLocationForNonEmptyDimension(ArrayAllocationExpression expression, int index) { |
2672 |
this.handle( |
2680 |
this.handle( |
Lines 3995-4001
Link Here
|
3995 |
new String[] {new String(type.shortReadableName())}, |
4003 |
new String[] {new String(type.shortReadableName())}, |
3996 |
severity, |
4004 |
severity, |
3997 |
location.sourceStart, |
4005 |
location.sourceStart, |
3998 |
location.sourceEnd); |
4006 |
nodeSourceEnd(null, location, modifiers)); |
3999 |
} |
4007 |
} |
4000 |
} |
4008 |
} |
4001 |
} |
4009 |
} |
Lines 5227-5233
Link Here
|
5227 |
if (index == 0) { |
5235 |
if (index == 0) { |
5228 |
return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]); |
5236 |
return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]); |
5229 |
} else { |
5237 |
} else { |
5230 |
return (int) (ref.sourcePositions[index]); |
5238 |
int length = ref.sourcePositions.length; |
|
|
5239 |
if (index < length) { |
5240 |
return (int) (ref.sourcePositions[index]); |
5241 |
} |
5242 |
return (int) (ref.sourcePositions[0]); |
5231 |
} |
5243 |
} |
5232 |
} |
5244 |
} |
5233 |
FieldBinding[] otherFields = ref.otherBindings; |
5245 |
FieldBinding[] otherFields = ref.otherBindings; |
Lines 5254-5260
Link Here
|
5254 |
} else if (node instanceof ArrayQualifiedTypeReference) { |
5266 |
} else if (node instanceof ArrayQualifiedTypeReference) { |
5255 |
ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node; |
5267 |
ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node; |
5256 |
int length = reference.sourcePositions.length; |
5268 |
int length = reference.sourcePositions.length; |
|
|
5269 |
if (index < length) { |
5270 |
return (int) reference.sourcePositions[index]; |
5271 |
} |
5257 |
return (int) reference.sourcePositions[length - 1]; |
5272 |
return (int) reference.sourcePositions[length - 1]; |
|
|
5273 |
} else if (node instanceof QualifiedTypeReference) { |
5274 |
QualifiedTypeReference reference = (QualifiedTypeReference) node; |
5275 |
int length = reference.sourcePositions.length; |
5276 |
if (index < length) { |
5277 |
return (int) reference.sourcePositions[index]; |
5278 |
} |
5258 |
} |
5279 |
} |
5259 |
return node.sourceEnd; |
5280 |
return node.sourceEnd; |
5260 |
} |
5281 |
} |
Lines 5621-5627
Link Here
|
5621 |
} |
5642 |
} |
5622 |
return nameBuffer.toString(); |
5643 |
return nameBuffer.toString(); |
5623 |
} |
5644 |
} |
5624 |
public void parameterizedMemberTypeMissingArguments(ASTNode location, TypeBinding type) { |
5645 |
public void parameterizedMemberTypeMissingArguments(ASTNode location, TypeBinding type, int index) { |
5625 |
if (location == null) { // binary case |
5646 |
if (location == null) { // binary case |
5626 |
this.handle( |
5647 |
this.handle( |
5627 |
IProblem.MissingArgumentsForParameterizedMemberType, |
5648 |
IProblem.MissingArgumentsForParameterizedMemberType, |
Lines 5637-5643
Link Here
|
5637 |
new String[] {new String(type.readableName())}, |
5658 |
new String[] {new String(type.readableName())}, |
5638 |
new String[] {new String(type.shortReadableName())}, |
5659 |
new String[] {new String(type.shortReadableName())}, |
5639 |
location.sourceStart, |
5660 |
location.sourceStart, |
5640 |
location.sourceEnd); |
5661 |
nodeSourceEnd(null, location, index)); |
5641 |
} |
5662 |
} |
5642 |
public void parseError( |
5663 |
public void parseError( |
5643 |
int startPosition, |
5664 |
int startPosition, |
Lines 5968-5974
Link Here
|
5968 |
new String[] {new String(type.readableName()), new String(type.erasure().readableName()), }, |
5989 |
new String[] {new String(type.readableName()), new String(type.erasure().readableName()), }, |
5969 |
new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),}, |
5990 |
new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),}, |
5970 |
location.sourceStart, |
5991 |
location.sourceStart, |
5971 |
nodeSourceEnd(null, location)); |
5992 |
nodeSourceEnd(null, location, Integer.MAX_VALUE)); |
5972 |
} |
5993 |
} |
5973 |
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) { |
5994 |
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) { |
5974 |
this.handle( |
5995 |
this.handle( |
Lines 6270-6276
Link Here
|
6270 |
type.sourceStart(), |
6291 |
type.sourceStart(), |
6271 |
type.sourceEnd()); |
6292 |
type.sourceEnd()); |
6272 |
} |
6293 |
} |
6273 |
public void staticMemberOfParameterizedType(ASTNode location, ReferenceBinding type) { |
6294 |
public void staticMemberOfParameterizedType(ASTNode location, ReferenceBinding type, int index) { |
6274 |
if (location == null) { // binary case |
6295 |
if (location == null) { // binary case |
6275 |
this.handle( |
6296 |
this.handle( |
6276 |
IProblem.StaticMemberOfParameterizedType, |
6297 |
IProblem.StaticMemberOfParameterizedType, |
Lines 6281-6287
Link Here
|
6281 |
0); |
6302 |
0); |
6282 |
return; |
6303 |
return; |
6283 |
} |
6304 |
} |
6284 |
int end = location.sourceEnd; |
|
|
6285 |
/*if (location instanceof ArrayTypeReference) { |
6305 |
/*if (location instanceof ArrayTypeReference) { |
6286 |
ArrayTypeReference arrayTypeReference = (ArrayTypeReference) location; |
6306 |
ArrayTypeReference arrayTypeReference = (ArrayTypeReference) location; |
6287 |
if (arrayTypeReference.token != null && arrayTypeReference.token.length == 0) return; |
6307 |
if (arrayTypeReference.token != null && arrayTypeReference.token.length == 0) return; |
Lines 6292-6298
Link Here
|
6292 |
new String[] {new String(type.readableName()), new String(type.enclosingType().readableName()), }, |
6312 |
new String[] {new String(type.readableName()), new String(type.enclosingType().readableName()), }, |
6293 |
new String[] {new String(type.shortReadableName()), new String(type.enclosingType().shortReadableName()), }, |
6313 |
new String[] {new String(type.shortReadableName()), new String(type.enclosingType().shortReadableName()), }, |
6294 |
location.sourceStart, |
6314 |
location.sourceStart, |
6295 |
end); |
6315 |
nodeSourceEnd(null, location, index)); |
6296 |
} |
6316 |
} |
6297 |
public void stringConstantIsExceedingUtf8Limit(ASTNode location) { |
6317 |
public void stringConstantIsExceedingUtf8Limit(ASTNode location) { |
6298 |
this.handle( |
6318 |
this.handle( |