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 3982-3987
Link Here
|
3982 |
} |
3990 |
} |
3983 |
} |
3991 |
} |
3984 |
public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) { |
3992 |
public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) { |
|
|
3993 |
javadocDeprecatedType(type, location, modifiers, Integer.MAX_VALUE); |
3994 |
} |
3995 |
public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers, int index) { |
3985 |
if (location == null) return; // 1G828DN - no type ref for synthetic arguments |
3996 |
if (location == null) return; // 1G828DN - no type ref for synthetic arguments |
3986 |
int severity = computeSeverity(IProblem.JavadocUsingDeprecatedType); |
3997 |
int severity = computeSeverity(IProblem.JavadocUsingDeprecatedType); |
3987 |
if (severity == ProblemSeverities.Ignore) return; |
3998 |
if (severity == ProblemSeverities.Ignore) return; |
Lines 3995-4001
Link Here
|
3995 |
new String[] {new String(type.shortReadableName())}, |
4006 |
new String[] {new String(type.shortReadableName())}, |
3996 |
severity, |
4007 |
severity, |
3997 |
location.sourceStart, |
4008 |
location.sourceStart, |
3998 |
location.sourceEnd); |
4009 |
nodeSourceEnd(null, location, index)); |
3999 |
} |
4010 |
} |
4000 |
} |
4011 |
} |
4001 |
} |
4012 |
} |
Lines 5227-5233
Link Here
|
5227 |
if (index == 0) { |
5238 |
if (index == 0) { |
5228 |
return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]); |
5239 |
return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]); |
5229 |
} else { |
5240 |
} else { |
5230 |
return (int) (ref.sourcePositions[index]); |
5241 |
int length = ref.sourcePositions.length; |
|
|
5242 |
if (index < length) { |
5243 |
return (int) (ref.sourcePositions[index]); |
5244 |
} |
5245 |
return (int) (ref.sourcePositions[0]); |
5231 |
} |
5246 |
} |
5232 |
} |
5247 |
} |
5233 |
FieldBinding[] otherFields = ref.otherBindings; |
5248 |
FieldBinding[] otherFields = ref.otherBindings; |
Lines 5254-5260
Link Here
|
5254 |
} else if (node instanceof ArrayQualifiedTypeReference) { |
5269 |
} else if (node instanceof ArrayQualifiedTypeReference) { |
5255 |
ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node; |
5270 |
ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node; |
5256 |
int length = reference.sourcePositions.length; |
5271 |
int length = reference.sourcePositions.length; |
|
|
5272 |
if (index < length) { |
5273 |
return (int) reference.sourcePositions[index]; |
5274 |
} |
5257 |
return (int) reference.sourcePositions[length - 1]; |
5275 |
return (int) reference.sourcePositions[length - 1]; |
|
|
5276 |
} else if (node instanceof QualifiedTypeReference) { |
5277 |
QualifiedTypeReference reference = (QualifiedTypeReference) node; |
5278 |
int length = reference.sourcePositions.length; |
5279 |
if (index < length) { |
5280 |
return (int) reference.sourcePositions[index]; |
5281 |
} |
5258 |
} |
5282 |
} |
5259 |
return node.sourceEnd; |
5283 |
return node.sourceEnd; |
5260 |
} |
5284 |
} |
Lines 5621-5627
Link Here
|
5621 |
} |
5645 |
} |
5622 |
return nameBuffer.toString(); |
5646 |
return nameBuffer.toString(); |
5623 |
} |
5647 |
} |
5624 |
public void parameterizedMemberTypeMissingArguments(ASTNode location, TypeBinding type) { |
5648 |
public void parameterizedMemberTypeMissingArguments(ASTNode location, TypeBinding type, int index) { |
5625 |
if (location == null) { // binary case |
5649 |
if (location == null) { // binary case |
5626 |
this.handle( |
5650 |
this.handle( |
5627 |
IProblem.MissingArgumentsForParameterizedMemberType, |
5651 |
IProblem.MissingArgumentsForParameterizedMemberType, |
Lines 5637-5643
Link Here
|
5637 |
new String[] {new String(type.readableName())}, |
5661 |
new String[] {new String(type.readableName())}, |
5638 |
new String[] {new String(type.shortReadableName())}, |
5662 |
new String[] {new String(type.shortReadableName())}, |
5639 |
location.sourceStart, |
5663 |
location.sourceStart, |
5640 |
location.sourceEnd); |
5664 |
nodeSourceEnd(null, location, index)); |
5641 |
} |
5665 |
} |
5642 |
public void parseError( |
5666 |
public void parseError( |
5643 |
int startPosition, |
5667 |
int startPosition, |
Lines 5968-5974
Link Here
|
5968 |
new String[] {new String(type.readableName()), new String(type.erasure().readableName()), }, |
5992 |
new String[] {new String(type.readableName()), new String(type.erasure().readableName()), }, |
5969 |
new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),}, |
5993 |
new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),}, |
5970 |
location.sourceStart, |
5994 |
location.sourceStart, |
5971 |
nodeSourceEnd(null, location)); |
5995 |
nodeSourceEnd(null, location, Integer.MAX_VALUE)); |
5972 |
} |
5996 |
} |
5973 |
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) { |
5997 |
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) { |
5974 |
this.handle( |
5998 |
this.handle( |
Lines 6270-6276
Link Here
|
6270 |
type.sourceStart(), |
6294 |
type.sourceStart(), |
6271 |
type.sourceEnd()); |
6295 |
type.sourceEnd()); |
6272 |
} |
6296 |
} |
6273 |
public void staticMemberOfParameterizedType(ASTNode location, ReferenceBinding type) { |
6297 |
public void staticMemberOfParameterizedType(ASTNode location, ReferenceBinding type, int index) { |
6274 |
if (location == null) { // binary case |
6298 |
if (location == null) { // binary case |
6275 |
this.handle( |
6299 |
this.handle( |
6276 |
IProblem.StaticMemberOfParameterizedType, |
6300 |
IProblem.StaticMemberOfParameterizedType, |
Lines 6281-6287
Link Here
|
6281 |
0); |
6305 |
0); |
6282 |
return; |
6306 |
return; |
6283 |
} |
6307 |
} |
6284 |
int end = location.sourceEnd; |
|
|
6285 |
/*if (location instanceof ArrayTypeReference) { |
6308 |
/*if (location instanceof ArrayTypeReference) { |
6286 |
ArrayTypeReference arrayTypeReference = (ArrayTypeReference) location; |
6309 |
ArrayTypeReference arrayTypeReference = (ArrayTypeReference) location; |
6287 |
if (arrayTypeReference.token != null && arrayTypeReference.token.length == 0) return; |
6310 |
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()), }, |
6315 |
new String[] {new String(type.readableName()), new String(type.enclosingType().readableName()), }, |
6293 |
new String[] {new String(type.shortReadableName()), new String(type.enclosingType().shortReadableName()), }, |
6316 |
new String[] {new String(type.shortReadableName()), new String(type.enclosingType().shortReadableName()), }, |
6294 |
location.sourceStart, |
6317 |
location.sourceStart, |
6295 |
end); |
6318 |
nodeSourceEnd(null, location, index)); |
6296 |
} |
6319 |
} |
6297 |
public void stringConstantIsExceedingUtf8Limit(ASTNode location) { |
6320 |
public void stringConstantIsExceedingUtf8Limit(ASTNode location) { |
6298 |
this.handle( |
6321 |
this.handle( |