Lines 155-163
Link Here
|
155 |
case IProblem.LocalVariableIsNeverUsed : |
155 |
case IProblem.LocalVariableIsNeverUsed : |
156 |
return CompilerOptions.UnusedLocalVariable; |
156 |
return CompilerOptions.UnusedLocalVariable; |
157 |
|
157 |
|
158 |
case IProblem.ArgumentIsNeverUsed : |
|
|
159 |
return CompilerOptions.UnusedArgument; |
160 |
|
161 |
case IProblem.NoImplicitStringConversionForCharArrayExpression : |
158 |
case IProblem.NoImplicitStringConversionForCharArrayExpression : |
162 |
return CompilerOptions.NoImplicitStringConversion; |
159 |
return CompilerOptions.NoImplicitStringConversion; |
163 |
|
160 |
|
Lines 167-176
Link Here
|
167 |
case IProblem.NeedToEmulateConstructorAccess : |
164 |
case IProblem.NeedToEmulateConstructorAccess : |
168 |
return CompilerOptions.AccessEmulation; |
165 |
return CompilerOptions.AccessEmulation; |
169 |
|
166 |
|
170 |
case IProblem.NonExternalizedStringLiteral : |
|
|
171 |
case IProblem.UnnecessaryNLSTag : |
172 |
return CompilerOptions.NonExternalizedString; |
173 |
|
174 |
case IProblem.UseAssertAsAnIdentifier : |
167 |
case IProblem.UseAssertAsAnIdentifier : |
175 |
return CompilerOptions.AssertUsedAsAnIdentifier; |
168 |
return CompilerOptions.AssertUsedAsAnIdentifier; |
176 |
|
169 |
|
Lines 228-237
Link Here
|
228 |
case IProblem.FinallyMustCompleteNormally: |
221 |
case IProblem.FinallyMustCompleteNormally: |
229 |
return CompilerOptions.FinallyBlockNotCompleting; |
222 |
return CompilerOptions.FinallyBlockNotCompleting; |
230 |
|
223 |
|
231 |
case IProblem.UnusedMethodDeclaredThrownException: |
|
|
232 |
case IProblem.UnusedConstructorDeclaredThrownException: |
233 |
return CompilerOptions.UnusedDeclaredThrownException; |
234 |
|
235 |
case IProblem.UnqualifiedFieldAccess: |
224 |
case IProblem.UnqualifiedFieldAccess: |
236 |
return CompilerOptions.UnqualifiedFieldAccess; |
225 |
return CompilerOptions.UnqualifiedFieldAccess; |
237 |
|
226 |
|
Lines 243-256
Link Here
|
243 |
case IProblem.UnsafeReturnTypeOverride: |
232 |
case IProblem.UnsafeReturnTypeOverride: |
244 |
return CompilerOptions.UncheckedTypeOperation; |
233 |
return CompilerOptions.UncheckedTypeOperation; |
245 |
|
234 |
|
246 |
case IProblem.MissingOverrideAnnotation: |
|
|
247 |
return CompilerOptions.MissingOverrideAnnotation; |
248 |
|
249 |
case IProblem.FieldMissingDeprecatedAnnotation: |
250 |
case IProblem.MethodMissingDeprecatedAnnotation: |
251 |
case IProblem.TypeMissingDeprecatedAnnotation: |
252 |
return CompilerOptions.MissingDeprecatedAnnotation; |
253 |
|
254 |
case IProblem.FinalBoundForTypeVariable: |
235 |
case IProblem.FinalBoundForTypeVariable: |
255 |
return CompilerOptions.FinalParameterBound; |
236 |
return CompilerOptions.FinalParameterBound; |
256 |
|
237 |
|
Lines 335-341
Link Here
|
335 |
case IProblem.JavadocParameterMismatch: |
316 |
case IProblem.JavadocParameterMismatch: |
336 |
case IProblem.JavadocUndefinedType: |
317 |
case IProblem.JavadocUndefinedType: |
337 |
case IProblem.JavadocAmbiguousType: |
318 |
case IProblem.JavadocAmbiguousType: |
338 |
case IProblem.JavadocInternalTypeNameProvided: |
|
|
339 |
case IProblem.JavadocNoMessageSendOnArrayType: |
319 |
case IProblem.JavadocNoMessageSendOnArrayType: |
340 |
case IProblem.JavadocNoMessageSendOnBaseType: |
320 |
case IProblem.JavadocNoMessageSendOnBaseType: |
341 |
case IProblem.JavadocInheritedMethodHidesEnclosingName: |
321 |
case IProblem.JavadocInheritedMethodHidesEnclosingName: |
Lines 351-357
Link Here
|
351 |
case IProblem.JavadocNonGenericConstructor: |
331 |
case IProblem.JavadocNonGenericConstructor: |
352 |
case IProblem.JavadocIncorrectArityForParameterizedConstructor: |
332 |
case IProblem.JavadocIncorrectArityForParameterizedConstructor: |
353 |
case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: |
333 |
case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: |
354 |
case IProblem.JavadocTypeArgumentsForRawGenericConstructor: |
|
|
355 |
case IProblem.JavadocNotVisibleField: |
334 |
case IProblem.JavadocNotVisibleField: |
356 |
case IProblem.JavadocNotVisibleConstructor: |
335 |
case IProblem.JavadocNotVisibleConstructor: |
357 |
case IProblem.JavadocNotVisibleMethod: |
336 |
case IProblem.JavadocNotVisibleMethod: |
Lines 433-441
Link Here
|
433 |
return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT; |
412 |
return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT; |
434 |
|
413 |
|
435 |
case (int)CompilerOptions.UnusedLocalVariable: |
414 |
case (int)CompilerOptions.UnusedLocalVariable: |
436 |
case (int)CompilerOptions.UnusedArgument: |
|
|
437 |
case (int)CompilerOptions.UnusedPrivateMember: |
415 |
case (int)CompilerOptions.UnusedPrivateMember: |
438 |
case (int)CompilerOptions.UnusedDeclaredThrownException: |
|
|
439 |
case (int)CompilerOptions.UnnecessaryTypeCheck: |
416 |
case (int)CompilerOptions.UnnecessaryTypeCheck: |
440 |
case (int)CompilerOptions.UnnecessaryElse: |
417 |
case (int)CompilerOptions.UnnecessaryElse: |
441 |
return CategorizedProblem.CAT_UNNECESSARY_CODE; |
418 |
return CategorizedProblem.CAT_UNNECESSARY_CODE; |
Lines 443-451
Link Here
|
443 |
case (int)CompilerOptions.UsingDeprecatedAPI: |
420 |
case (int)CompilerOptions.UsingDeprecatedAPI: |
444 |
return CategorizedProblem.CAT_DEPRECATION; |
421 |
return CategorizedProblem.CAT_DEPRECATION; |
445 |
|
422 |
|
446 |
case (int)CompilerOptions.NonExternalizedString: |
|
|
447 |
return CategorizedProblem.CAT_NLS; |
448 |
|
449 |
case (int)CompilerOptions.Task: |
423 |
case (int)CompilerOptions.Task: |
450 |
return CategorizedProblem.CAT_UNSPECIFIED; // TODO may want to improve |
424 |
return CategorizedProblem.CAT_UNSPECIFIED; // TODO may want to improve |
451 |
|
425 |
|
Lines 506-512
Link Here
|
506 |
// categorize fatal problems per ID |
480 |
// categorize fatal problems per ID |
507 |
switch (problemID) { |
481 |
switch (problemID) { |
508 |
case IProblem.IsClassPathCorrect : |
482 |
case IProblem.IsClassPathCorrect : |
509 |
case IProblem.CorruptedSignature : |
|
|
510 |
return CategorizedProblem.CAT_BUILDPATH; |
483 |
return CategorizedProblem.CAT_BUILDPATH; |
511 |
|
484 |
|
512 |
default : |
485 |
default : |
Lines 1019-1032
Link Here
|
1019 |
start, |
992 |
start, |
1020 |
end); |
993 |
end); |
1021 |
} |
994 |
} |
1022 |
public void cannotUseSuperInJavaLangObject(ASTNode reference) { |
|
|
1023 |
this.handle( |
1024 |
IProblem.ObjectHasNoSuperclass, |
1025 |
NoArgument, |
1026 |
NoArgument, |
1027 |
reference.sourceStart, |
1028 |
reference.sourceEnd); |
1029 |
} |
1030 |
public void caseExpressionMustBeConstant(Expression expression) { |
995 |
public void caseExpressionMustBeConstant(Expression expression) { |
1031 |
this.handle( |
996 |
this.handle( |
1032 |
IProblem.NonConstantExpression, |
997 |
IProblem.NonConstantExpression, |
Lines 1129-1135
Link Here
|
1129 |
case IProblem.JavadocParameterMismatch: |
1094 |
case IProblem.JavadocParameterMismatch: |
1130 |
case IProblem.JavadocUndefinedType: |
1095 |
case IProblem.JavadocUndefinedType: |
1131 |
case IProblem.JavadocAmbiguousType: |
1096 |
case IProblem.JavadocAmbiguousType: |
1132 |
case IProblem.JavadocInternalTypeNameProvided: |
|
|
1133 |
case IProblem.JavadocNoMessageSendOnArrayType: |
1097 |
case IProblem.JavadocNoMessageSendOnArrayType: |
1134 |
case IProblem.JavadocNoMessageSendOnBaseType: |
1098 |
case IProblem.JavadocNoMessageSendOnBaseType: |
1135 |
case IProblem.JavadocInheritedMethodHidesEnclosingName: |
1099 |
case IProblem.JavadocInheritedMethodHidesEnclosingName: |
Lines 1145-1151
Link Here
|
1145 |
case IProblem.JavadocNonGenericConstructor: |
1109 |
case IProblem.JavadocNonGenericConstructor: |
1146 |
case IProblem.JavadocIncorrectArityForParameterizedConstructor: |
1110 |
case IProblem.JavadocIncorrectArityForParameterizedConstructor: |
1147 |
case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: |
1111 |
case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: |
1148 |
case IProblem.JavadocTypeArgumentsForRawGenericConstructor: |
|
|
1149 |
case IProblem.JavadocEmptyReturnTag: |
1112 |
case IProblem.JavadocEmptyReturnTag: |
1150 |
if (!this.options.reportInvalidJavadocTags) { |
1113 |
if (!this.options.reportInvalidJavadocTags) { |
1151 |
return ProblemSeverities.Ignore; |
1114 |
return ProblemSeverities.Ignore; |
Lines 1254-1268
Link Here
|
1254 |
literal.sourceStart, |
1217 |
literal.sourceStart, |
1255 |
literal.sourceEnd); |
1218 |
literal.sourceEnd); |
1256 |
} |
1219 |
} |
1257 |
public void corruptedSignature(TypeBinding enclosingType, char[] signature, int position) { |
|
|
1258 |
this.handle( |
1259 |
IProblem.CorruptedSignature, |
1260 |
new String[] { new String(enclosingType.readableName()), new String(signature), String.valueOf(position) }, |
1261 |
new String[] { new String(enclosingType.shortReadableName()), new String(signature), String.valueOf(position) }, |
1262 |
ProblemSeverities.Error | ProblemSeverities.Abort | ProblemSeverities.Fatal, |
1263 |
0, |
1264 |
0); |
1265 |
} |
1266 |
public void deprecatedField(FieldBinding field, ASTNode location) { |
1220 |
public void deprecatedField(FieldBinding field, ASTNode location) { |
1267 |
int severity = computeSeverity(IProblem.UsingDeprecatedField); |
1221 |
int severity = computeSeverity(IProblem.UsingDeprecatedField); |
1268 |
if (severity == ProblemSeverities.Ignore) return; |
1222 |
if (severity == ProblemSeverities.Ignore) return; |
Lines 2399-2415
Link Here
|
2399 |
(int) importRef.sourcePositions[tokens.length - 1]); |
2353 |
(int) importRef.sourcePositions[tokens.length - 1]); |
2400 |
return; |
2354 |
return; |
2401 |
} |
2355 |
} |
2402 |
if (expectedImport.problemId() == ProblemReasons.InvalidTypeForStaticImport) { |
|
|
2403 |
char[][] tokens = importRef.tokens; |
2404 |
String[] arguments = new String[]{CharOperation.toString(tokens)}; |
2405 |
this.handle( |
2406 |
IProblem.InvalidTypeForStaticImport, |
2407 |
arguments, |
2408 |
arguments, |
2409 |
importRef.sourceStart, |
2410 |
(int) importRef.sourcePositions[tokens.length - 1]); |
2411 |
return; |
2412 |
} |
2413 |
invalidType(importRef, (TypeBinding)expectedImport); |
2356 |
invalidType(importRef, (TypeBinding)expectedImport); |
2414 |
} |
2357 |
} |
2415 |
public void incompatibleExceptionInThrowsClause(SourceTypeBinding type, MethodBinding currentMethod, MethodBinding inheritedMethod, ReferenceBinding exceptionType) { |
2358 |
public void incompatibleExceptionInThrowsClause(SourceTypeBinding type, MethodBinding currentMethod, MethodBinding inheritedMethod, ReferenceBinding exceptionType) { |
Lines 2940-2948
Link Here
|
2940 |
case ProblemReasons.Ambiguous : // 3 |
2883 |
case ProblemReasons.Ambiguous : // 3 |
2941 |
flag = IProblem.AmbiguousType; |
2884 |
flag = IProblem.AmbiguousType; |
2942 |
break; |
2885 |
break; |
2943 |
case ProblemReasons.InternalNameProvided : |
|
|
2944 |
flag = IProblem.InternalTypeNameProvided; |
2945 |
break; |
2946 |
case ProblemReasons.NoError : // 0 |
2886 |
case ProblemReasons.NoError : // 0 |
2947 |
default : |
2887 |
default : |
2948 |
needImplementation(); // want to fail to see why we were here... |
2888 |
needImplementation(); // want to fail to see why we were here... |
Lines 3498-3506
Link Here
|
3498 |
case ProblemReasons.Ambiguous : |
3438 |
case ProblemReasons.Ambiguous : |
3499 |
id = IProblem.AmbiguousType; |
3439 |
id = IProblem.AmbiguousType; |
3500 |
break; |
3440 |
break; |
3501 |
case ProblemReasons.InternalNameProvided : |
|
|
3502 |
id = IProblem.InternalTypeNameProvided; |
3503 |
break; |
3504 |
case ProblemReasons.InheritedNameHidesEnclosingName : |
3441 |
case ProblemReasons.InheritedNameHidesEnclosingName : |
3505 |
id = IProblem.InheritedTypeHidesEnclosingName; |
3442 |
id = IProblem.InheritedTypeHidesEnclosingName; |
3506 |
break; |
3443 |
break; |
Lines 4067-4093
Link Here
|
4067 |
sourceStart, |
4004 |
sourceStart, |
4068 |
sourceEnd); |
4005 |
sourceEnd); |
4069 |
return; |
4006 |
return; |
4070 |
case ProblemReasons.TypeArgumentsForRawGenericMethod : |
|
|
4071 |
severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericConstructor); |
4072 |
if (severity == ProblemSeverities.Ignore) return; |
4073 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
4074 |
shownConstructor = problemConstructor.closestMatch; |
4075 |
this.handle( |
4076 |
IProblem.JavadocTypeArgumentsForRawGenericConstructor, |
4077 |
new String[] { |
4078 |
new String(shownConstructor.declaringClass.sourceName()), |
4079 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
4080 |
new String(shownConstructor.declaringClass.readableName()), |
4081 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
4082 |
new String[] { |
4083 |
new String(shownConstructor.declaringClass.sourceName()), |
4084 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
4085 |
new String(shownConstructor.declaringClass.shortReadableName()), |
4086 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
4087 |
severity, |
4088 |
sourceStart, |
4089 |
sourceEnd); |
4090 |
return; |
4091 |
case ProblemReasons.NoError : // 0 |
4007 |
case ProblemReasons.NoError : // 0 |
4092 |
default : |
4008 |
default : |
4093 |
needImplementation(); // want to fail to see why we were here... |
4009 |
needImplementation(); // want to fail to see why we were here... |
Lines 4387-4395
Link Here
|
4387 |
case ProblemReasons.Ambiguous : |
4303 |
case ProblemReasons.Ambiguous : |
4388 |
id = IProblem.JavadocAmbiguousType; |
4304 |
id = IProblem.JavadocAmbiguousType; |
4389 |
break; |
4305 |
break; |
4390 |
case ProblemReasons.InternalNameProvided : |
|
|
4391 |
id = IProblem.JavadocInternalTypeNameProvided; |
4392 |
break; |
4393 |
case ProblemReasons.InheritedNameHidesEnclosingName : |
4306 |
case ProblemReasons.InheritedNameHidesEnclosingName : |
4394 |
id = IProblem.JavadocInheritedNameHidesEnclosingTypeName; |
4307 |
id = IProblem.JavadocInheritedNameHidesEnclosingTypeName; |
4395 |
break; |
4308 |
break; |
Lines 4758-4803
Link Here
|
4758 |
methodDecl.sourceStart, |
4671 |
methodDecl.sourceStart, |
4759 |
methodDecl.sourceEnd); |
4672 |
methodDecl.sourceEnd); |
4760 |
} |
4673 |
} |
4761 |
public void missingDeprecatedAnnotationForField(FieldDeclaration field) { |
|
|
4762 |
int severity = computeSeverity(IProblem.FieldMissingDeprecatedAnnotation); |
4763 |
if (severity == ProblemSeverities.Ignore) return; |
4764 |
FieldBinding binding = field.binding; |
4765 |
this.handle( |
4766 |
IProblem.FieldMissingDeprecatedAnnotation, |
4767 |
new String[] {new String(binding.declaringClass.readableName()), new String(binding.name), }, |
4768 |
new String[] {new String(binding.declaringClass.shortReadableName()), new String(binding.name), }, |
4769 |
severity, |
4770 |
nodeSourceStart(binding, field), |
4771 |
nodeSourceEnd(binding, field)); |
4772 |
} |
4773 |
public void missingDeprecatedAnnotationForMethod(AbstractMethodDeclaration method) { |
4774 |
int severity = computeSeverity(IProblem.MethodMissingDeprecatedAnnotation); |
4775 |
if (severity == ProblemSeverities.Ignore) return; |
4776 |
MethodBinding binding = method.binding; |
4777 |
char[] methodSelector = binding.selector; |
4778 |
if(methodSelector == null) |
4779 |
methodSelector = method.getSafeName(); |
4780 |
|
4781 |
this.handle( |
4782 |
IProblem.MethodMissingDeprecatedAnnotation, |
4783 |
new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), }, |
4784 |
new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),}, |
4785 |
severity, |
4786 |
method.sourceStart, |
4787 |
method.sourceEnd); |
4788 |
} |
4789 |
public void missingDeprecatedAnnotationForType(TypeDeclaration type) { |
4790 |
int severity = computeSeverity(IProblem.TypeMissingDeprecatedAnnotation); |
4791 |
if (severity == ProblemSeverities.Ignore) return; |
4792 |
TypeBinding binding = type.binding; |
4793 |
this.handle( |
4794 |
IProblem.TypeMissingDeprecatedAnnotation, |
4795 |
new String[] {new String(binding.readableName()), }, |
4796 |
new String[] {new String(binding.shortReadableName()),}, |
4797 |
severity, |
4798 |
type.sourceStart, |
4799 |
type.sourceEnd); |
4800 |
} |
4801 |
public void missingEnumConstantCase(SwitchStatement switchStatement, FieldBinding enumConstant) { |
4674 |
public void missingEnumConstantCase(SwitchStatement switchStatement, FieldBinding enumConstant) { |
4802 |
this.handle( |
4675 |
this.handle( |
4803 |
IProblem.MissingEnumConstantCase, |
4676 |
IProblem.MissingEnumConstantCase, |
Lines 4806-4827
Link Here
|
4806 |
switchStatement.expression.sourceStart, |
4679 |
switchStatement.expression.sourceStart, |
4807 |
switchStatement.expression.sourceEnd); |
4680 |
switchStatement.expression.sourceEnd); |
4808 |
} |
4681 |
} |
4809 |
public void missingOverrideAnnotation(AbstractMethodDeclaration method) { |
|
|
4810 |
int severity = computeSeverity(IProblem.MissingOverrideAnnotation); |
4811 |
if (severity == ProblemSeverities.Ignore) return; |
4812 |
MethodBinding binding = method.binding; |
4813 |
char[] methodSelector = binding.selector; |
4814 |
if(methodSelector == null) |
4815 |
methodSelector = method.getSafeName(); |
4816 |
|
4817 |
this.handle( |
4818 |
IProblem.MissingOverrideAnnotation, |
4819 |
new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), }, |
4820 |
new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),}, |
4821 |
severity, |
4822 |
method.sourceStart, |
4823 |
method.sourceEnd); |
4824 |
} |
4825 |
public void missingReturnType(AbstractMethodDeclaration methodDecl) { |
4682 |
public void missingReturnType(AbstractMethodDeclaration methodDecl) { |
4826 |
this.handle( |
4683 |
this.handle( |
4827 |
IProblem.MissingReturnType, |
4684 |
IProblem.MissingReturnType, |
Lines 4882-4896
Link Here
|
4882 |
messageSend.sourceStart, |
4739 |
messageSend.sourceStart, |
4883 |
messageSend.sourceEnd); |
4740 |
messageSend.sourceEnd); |
4884 |
} |
4741 |
} |
4885 |
public void nativeMethodsCannotBeStrictfp(ReferenceBinding type, AbstractMethodDeclaration methodDecl) { |
|
|
4886 |
String[] arguments = new String[] {new String(type.sourceName()), new String(methodDecl.getSafeName())}; |
4887 |
this.handle( |
4888 |
IProblem.NativeMethodsCannotBeStrictfp, |
4889 |
arguments, |
4890 |
arguments, |
4891 |
methodDecl.sourceStart, |
4892 |
methodDecl.sourceEnd); |
4893 |
} |
4894 |
public void needImplementation() { |
4742 |
public void needImplementation() { |
4895 |
this.abortDueToInternalError(Messages.abort_missingCode); |
4743 |
this.abortDueToInternalError(Messages.abort_missingCode); |
4896 |
} |
4744 |
} |
Lines 5055-5069
Link Here
|
5055 |
typeDeclaration.sourceStart, |
4903 |
typeDeclaration.sourceStart, |
5056 |
typeDeclaration.sourceEnd); |
4904 |
typeDeclaration.sourceEnd); |
5057 |
} |
4905 |
} |
5058 |
|
|
|
5059 |
public void nonExternalizedStringLiteral(ASTNode location) { |
5060 |
this.handle( |
5061 |
IProblem.NonExternalizedStringLiteral, |
5062 |
NoArgument, |
5063 |
NoArgument, |
5064 |
location.sourceStart, |
5065 |
location.sourceEnd); |
5066 |
} |
5067 |
public void nonGenericTypeCannotBeParameterized(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { |
4906 |
public void nonGenericTypeCannotBeParameterized(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { |
5068 |
this.nonGenericTypeCannotBeParameterized(0, location, type, argumentTypes); |
4907 |
this.nonGenericTypeCannotBeParameterized(0, location, type, argumentTypes); |
5069 |
} |
4908 |
} |
Lines 5208-5237
Link Here
|
5208 |
expression.sourceStart, |
5047 |
expression.sourceStart, |
5209 |
expression.sourceEnd); |
5048 |
expression.sourceEnd); |
5210 |
} |
5049 |
} |
5211 |
public void objectCannotBeGeneric(TypeDeclaration typeDecl) { |
|
|
5212 |
this.handle( |
5213 |
IProblem.ObjectCannotBeGeneric, |
5214 |
NoArgument, |
5215 |
NoArgument, |
5216 |
typeDecl.typeParameters[0].sourceStart, |
5217 |
typeDecl.typeParameters[typeDecl.typeParameters.length-1].sourceEnd); |
5218 |
} |
5219 |
public void objectCannotHaveSuperTypes(SourceTypeBinding type) { |
5220 |
this.handle( |
5221 |
IProblem.ObjectCannotHaveSuperTypes, |
5222 |
NoArgument, |
5223 |
NoArgument, |
5224 |
type.sourceStart(), |
5225 |
type.sourceEnd()); |
5226 |
} |
5227 |
public void objectMustBeClass(SourceTypeBinding type) { |
5228 |
this.handle( |
5229 |
IProblem.ObjectMustBeClass, |
5230 |
NoArgument, |
5231 |
NoArgument, |
5232 |
type.sourceStart(), |
5233 |
type.sourceEnd()); |
5234 |
} |
5235 |
public void operatorOnlyValidOnNumericType(CompoundAssignment assignment, TypeBinding leftType, TypeBinding rightType) { |
5050 |
public void operatorOnlyValidOnNumericType(CompoundAssignment assignment, TypeBinding leftType, TypeBinding rightType) { |
5236 |
String leftName = new String(leftType.readableName()); |
5051 |
String leftName = new String(leftType.readableName()); |
5237 |
String rightName = new String(rightType.readableName()); |
5052 |
String rightName = new String(rightType.readableName()); |
Lines 6381-6394
Link Here
|
6381 |
instanceofExpression.sourceStart, |
6196 |
instanceofExpression.sourceStart, |
6382 |
instanceofExpression.sourceEnd); |
6197 |
instanceofExpression.sourceEnd); |
6383 |
} |
6198 |
} |
6384 |
public void unnecessaryNLSTags(int sourceStart, int sourceEnd) { |
|
|
6385 |
this.handle( |
6386 |
IProblem.UnnecessaryNLSTag, |
6387 |
NoArgument, |
6388 |
NoArgument, |
6389 |
sourceStart, |
6390 |
sourceEnd); |
6391 |
} |
6392 |
public void unqualifiedFieldAccess(NameReference reference, FieldBinding field) { |
6199 |
public void unqualifiedFieldAccess(NameReference reference, FieldBinding field) { |
6393 |
int sourceStart = reference.sourceStart; |
6200 |
int sourceStart = reference.sourceStart; |
6394 |
int sourceEnd = reference.sourceEnd; |
6201 |
int sourceEnd = reference.sourceEnd; |
Lines 6532-6589
Link Here
|
6532 |
expression.sourceStart, |
6339 |
expression.sourceStart, |
6533 |
expression.sourceEnd); |
6340 |
expression.sourceEnd); |
6534 |
} |
6341 |
} |
6535 |
public void unusedArgument(LocalDeclaration localDecl) { |
|
|
6536 |
int severity = computeSeverity(IProblem.ArgumentIsNeverUsed); |
6537 |
if (severity == ProblemSeverities.Ignore) return; |
6538 |
String[] arguments = new String[] {new String(localDecl.name)}; |
6539 |
this.handle( |
6540 |
IProblem.ArgumentIsNeverUsed, |
6541 |
arguments, |
6542 |
arguments, |
6543 |
severity, |
6544 |
localDecl.sourceStart, |
6545 |
localDecl.sourceEnd); |
6546 |
} |
6547 |
public void unusedDeclaredThrownException(ReferenceBinding exceptionType, AbstractMethodDeclaration method, ASTNode location) { |
6548 |
boolean isConstructor = method.isConstructor(); |
6549 |
int severity = computeSeverity(isConstructor ? IProblem.UnusedConstructorDeclaredThrownException : IProblem.UnusedMethodDeclaredThrownException); |
6550 |
if (severity == ProblemSeverities.Ignore) return; |
6551 |
if (isConstructor) { |
6552 |
this.handle( |
6553 |
IProblem.UnusedConstructorDeclaredThrownException, |
6554 |
new String[] { |
6555 |
new String(method.binding.declaringClass.readableName()), |
6556 |
typesAsString(method.binding.isVarargs(), method.binding.parameters, false), |
6557 |
new String(exceptionType.readableName()), |
6558 |
}, |
6559 |
new String[] { |
6560 |
new String(method.binding.declaringClass.shortReadableName()), |
6561 |
typesAsString(method.binding.isVarargs(), method.binding.parameters, true), |
6562 |
new String(exceptionType.shortReadableName()), |
6563 |
}, |
6564 |
severity, |
6565 |
location.sourceStart, |
6566 |
location.sourceEnd); |
6567 |
} else { |
6568 |
this.handle( |
6569 |
IProblem.UnusedMethodDeclaredThrownException, |
6570 |
new String[] { |
6571 |
new String(method.binding.declaringClass.readableName()), |
6572 |
new String(method.getSafeName()), |
6573 |
typesAsString(method.binding.isVarargs(), method.binding.parameters, false), |
6574 |
new String(exceptionType.readableName()), |
6575 |
}, |
6576 |
new String[] { |
6577 |
new String(method.binding.declaringClass.shortReadableName()), |
6578 |
new String(method.getSafeName()), |
6579 |
typesAsString(method.binding.isVarargs(), method.binding.parameters, true), |
6580 |
new String(exceptionType.shortReadableName()), |
6581 |
}, |
6582 |
severity, |
6583 |
location.sourceStart, |
6584 |
location.sourceEnd); |
6585 |
} |
6586 |
} |
6587 |
public void unusedLabel(LabeledStatement statement) { |
6342 |
public void unusedLabel(LabeledStatement statement) { |
6588 |
int severity = computeSeverity(IProblem.UnusedLabel); |
6343 |
int severity = computeSeverity(IProblem.UnusedLabel); |
6589 |
if (severity == ProblemSeverities.Ignore) return; |
6344 |
if (severity == ProblemSeverities.Ignore) return; |