Lines 29-36
Link Here
|
29 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration; |
29 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration; |
30 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration; |
30 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration; |
31 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression; |
31 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression; |
32 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Annotation; |
|
|
33 |
import org.eclipse.wst.jsdt.internal.compiler.ast.AnnotationMethodDeclaration; |
34 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument; |
32 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument; |
35 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression; |
33 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression; |
36 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayQualifiedTypeReference; |
34 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayQualifiedTypeReference; |
Lines 59-65
Link Here
|
59 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Literal; |
57 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Literal; |
60 |
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration; |
58 |
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration; |
61 |
import org.eclipse.wst.jsdt.internal.compiler.ast.LongLiteral; |
59 |
import org.eclipse.wst.jsdt.internal.compiler.ast.LongLiteral; |
62 |
import org.eclipse.wst.jsdt.internal.compiler.ast.MemberValuePair; |
|
|
63 |
import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend; |
60 |
import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend; |
64 |
import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration; |
61 |
import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration; |
65 |
import org.eclipse.wst.jsdt.internal.compiler.ast.NameReference; |
62 |
import org.eclipse.wst.jsdt.internal.compiler.ast.NameReference; |
Lines 72-78
Link Here
|
72 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement; |
69 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement; |
73 |
import org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference; |
70 |
import org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference; |
74 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Statement; |
71 |
import org.eclipse.wst.jsdt.internal.compiler.ast.Statement; |
75 |
import org.eclipse.wst.jsdt.internal.compiler.ast.SwitchStatement; |
|
|
76 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference; |
72 |
import org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference; |
77 |
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration; |
73 |
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration; |
78 |
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeParameter; |
74 |
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeParameter; |
Lines 89-95
Link Here
|
89 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite; |
85 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite; |
90 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding; |
86 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding; |
91 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding; |
87 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding; |
92 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ParameterizedGenericMethodBinding; |
|
|
93 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemMethodBinding; |
88 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemMethodBinding; |
94 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReasons; |
89 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReasons; |
95 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding; |
90 |
import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReferenceBinding; |
Lines 206-213
Link Here
|
206 |
return CompilerOptions.FieldHiding; |
201 |
return CompilerOptions.FieldHiding; |
207 |
|
202 |
|
208 |
case IProblem.TypeParameterHidingType: |
203 |
case IProblem.TypeParameterHidingType: |
209 |
case IProblem.TypeHidingTypeParameterFromType: |
|
|
210 |
case IProblem.TypeHidingTypeParameterFromMethod: |
211 |
case IProblem.TypeHidingType: |
204 |
case IProblem.TypeHidingType: |
212 |
return CompilerOptions.TypeHiding; |
205 |
return CompilerOptions.TypeHiding; |
213 |
|
206 |
|
Lines 243-256
Link Here
|
243 |
case IProblem.UnsafeReturnTypeOverride: |
236 |
case IProblem.UnsafeReturnTypeOverride: |
244 |
return CompilerOptions.UncheckedTypeOperation; |
237 |
return CompilerOptions.UncheckedTypeOperation; |
245 |
|
238 |
|
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: |
239 |
case IProblem.FinalBoundForTypeVariable: |
255 |
return CompilerOptions.FinalParameterBound; |
240 |
return CompilerOptions.FinalParameterBound; |
256 |
|
241 |
|
Lines 263-272
Link Here
|
263 |
case IProblem.DiscouragedReference: |
248 |
case IProblem.DiscouragedReference: |
264 |
return CompilerOptions.DiscouragedReference; |
249 |
return CompilerOptions.DiscouragedReference; |
265 |
|
250 |
|
266 |
case IProblem.MethodVarargsArgumentNeedCast : |
|
|
267 |
case IProblem.ConstructorVarargsArgumentNeedCast : |
268 |
return CompilerOptions.VarargsArgumentNeedCast; |
269 |
|
270 |
case IProblem.NullLocalVariableReference: |
251 |
case IProblem.NullLocalVariableReference: |
271 |
return CompilerOptions.NullReference; |
252 |
return CompilerOptions.NullReference; |
272 |
|
253 |
|
Lines 288-302
Link Here
|
288 |
case IProblem.UnboxingConversion : |
269 |
case IProblem.UnboxingConversion : |
289 |
return CompilerOptions.AutoBoxing; |
270 |
return CompilerOptions.AutoBoxing; |
290 |
|
271 |
|
291 |
case IProblem.MissingEnumConstantCase : |
|
|
292 |
return CompilerOptions.IncompleteEnumSwitch; |
293 |
|
294 |
case IProblem.AnnotationTypeUsedAsSuperInterface : |
295 |
return CompilerOptions.AnnotationSuperInterface; |
296 |
|
297 |
case IProblem.UnhandledWarningToken : |
298 |
return CompilerOptions.UnhandledWarningToken; |
299 |
|
300 |
case IProblem.UnusedLabel : |
272 |
case IProblem.UnusedLabel : |
301 |
return CompilerOptions.UnusedLabel; |
273 |
return CompilerOptions.UnusedLabel; |
302 |
|
274 |
|
Lines 342-357
Link Here
|
342 |
case IProblem.JavadocInheritedFieldHidesEnclosingName: |
314 |
case IProblem.JavadocInheritedFieldHidesEnclosingName: |
343 |
case IProblem.JavadocInheritedNameHidesEnclosingTypeName: |
315 |
case IProblem.JavadocInheritedNameHidesEnclosingTypeName: |
344 |
case IProblem.JavadocNonStaticTypeFromStaticInvocation: |
316 |
case IProblem.JavadocNonStaticTypeFromStaticInvocation: |
345 |
case IProblem.JavadocGenericMethodTypeArgumentMismatch: |
|
|
346 |
case IProblem.JavadocNonGenericMethod: |
347 |
case IProblem.JavadocIncorrectArityForParameterizedMethod: |
348 |
case IProblem.JavadocParameterizedMethodArgumentTypeMismatch: |
349 |
case IProblem.JavadocTypeArgumentsForRawGenericMethod: |
350 |
case IProblem.JavadocGenericConstructorTypeArgumentMismatch: |
351 |
case IProblem.JavadocNonGenericConstructor: |
352 |
case IProblem.JavadocIncorrectArityForParameterizedConstructor: |
353 |
case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: |
354 |
case IProblem.JavadocTypeArgumentsForRawGenericConstructor: |
355 |
case IProblem.JavadocNotVisibleField: |
317 |
case IProblem.JavadocNotVisibleField: |
356 |
case IProblem.JavadocNotVisibleConstructor: |
318 |
case IProblem.JavadocNotVisibleConstructor: |
357 |
case IProblem.JavadocNotVisibleMethod: |
319 |
case IProblem.JavadocNotVisibleMethod: |
Lines 385-392
Link Here
|
385 |
case IProblem.WrongNumberOfArguments: |
347 |
case IProblem.WrongNumberOfArguments: |
386 |
return CompilerOptions.WrongNumberOfArguments; |
348 |
return CompilerOptions.WrongNumberOfArguments; |
387 |
|
349 |
|
388 |
case IProblem.NonConstantExpression: |
|
|
389 |
return CompilerOptions.SwitchCaseShouldBeConstant; |
390 |
case IProblem.MissingSemiColon: |
350 |
case IProblem.MissingSemiColon: |
391 |
return CompilerOptions.OptionalSemicolon; |
351 |
return CompilerOptions.OptionalSemicolon; |
392 |
|
352 |
|
Lines 466-485
Link Here
|
466 |
switch (irritantInt) { |
426 |
switch (irritantInt) { |
467 |
case (int)(CompilerOptions.FinalParameterBound >>> 32): |
427 |
case (int)(CompilerOptions.FinalParameterBound >>> 32): |
468 |
case (int)(CompilerOptions.EnumUsedAsAnIdentifier >>> 32): |
428 |
case (int)(CompilerOptions.EnumUsedAsAnIdentifier >>> 32): |
469 |
case (int)(CompilerOptions.AnnotationSuperInterface >>> 32): |
|
|
470 |
case (int)(CompilerOptions.AutoBoxing >>> 32): |
429 |
case (int)(CompilerOptions.AutoBoxing >>> 32): |
471 |
case (int)(CompilerOptions.MissingOverrideAnnotation >>> 32): |
|
|
472 |
case (int)(CompilerOptions.MissingDeprecatedAnnotation >>> 32): |
473 |
case (int)(CompilerOptions.ParameterAssignment >>> 32): |
430 |
case (int)(CompilerOptions.ParameterAssignment >>> 32): |
474 |
return CategorizedProblem.CAT_CODE_STYLE; |
431 |
return CategorizedProblem.CAT_CODE_STYLE; |
475 |
|
432 |
|
476 |
case (int)(CompilerOptions.MissingSerialVersion >>> 32): |
433 |
case (int)(CompilerOptions.MissingSerialVersion >>> 32): |
477 |
case (int)(CompilerOptions.VarargsArgumentNeedCast >>> 32): |
|
|
478 |
case (int)(CompilerOptions.NullReference >>> 32): |
434 |
case (int)(CompilerOptions.NullReference >>> 32): |
479 |
case (int)(CompilerOptions.PotentialNullReference >>> 32): |
435 |
case (int)(CompilerOptions.PotentialNullReference >>> 32): |
480 |
case (int)(CompilerOptions.DuplicateLocalVariables >>> 32): |
436 |
case (int)(CompilerOptions.DuplicateLocalVariables >>> 32): |
481 |
case (int)(CompilerOptions.RedundantNullCheck >>> 32): |
437 |
case (int)(CompilerOptions.RedundantNullCheck >>> 32): |
482 |
case (int)(CompilerOptions.IncompleteEnumSwitch >>> 32): |
|
|
483 |
case (int)(CompilerOptions.FallthroughCase >>> 32): |
438 |
case (int)(CompilerOptions.FallthroughCase >>> 32): |
484 |
case (int)(CompilerOptions.OverridingMethodWithoutSuperInvocation >>> 32): |
439 |
case (int)(CompilerOptions.OverridingMethodWithoutSuperInvocation >>> 32): |
485 |
return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM; |
440 |
return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM; |
Lines 487-493
Link Here
|
487 |
case (int)(CompilerOptions.TypeHiding >>> 32): |
442 |
case (int)(CompilerOptions.TypeHiding >>> 32): |
488 |
return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT; |
443 |
return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT; |
489 |
|
444 |
|
490 |
case (int)(CompilerOptions.UnhandledWarningToken >>> 32): |
|
|
491 |
case (int)(CompilerOptions.UnusedLabel >>> 32): |
445 |
case (int)(CompilerOptions.UnusedLabel >>> 32): |
492 |
return CategorizedProblem.CAT_UNNECESSARY_CODE; |
446 |
return CategorizedProblem.CAT_UNNECESSARY_CODE; |
493 |
|
447 |
|
Lines 608-739
Link Here
|
608 |
location.sourceStart, |
562 |
location.sourceStart, |
609 |
location.sourceEnd); |
563 |
location.sourceEnd); |
610 |
} |
564 |
} |
611 |
public void annotationCannotOverrideMethod(MethodBinding overrideMethod, MethodBinding inheritedMethod) { |
|
|
612 |
ASTNode location = overrideMethod.sourceMethod(); |
613 |
this.handle( |
614 |
IProblem.AnnotationCannotOverrideMethod, |
615 |
new String[] { |
616 |
new String(overrideMethod.declaringClass.readableName()), |
617 |
new String(inheritedMethod.declaringClass.readableName()), |
618 |
new String(inheritedMethod.selector), |
619 |
typesAsString(inheritedMethod.isVarargs(), inheritedMethod.parameters, false)}, |
620 |
new String[] { |
621 |
new String(overrideMethod.declaringClass.shortReadableName()), |
622 |
new String(inheritedMethod.declaringClass.shortReadableName()), |
623 |
new String(inheritedMethod.selector), |
624 |
typesAsString(inheritedMethod.isVarargs(), inheritedMethod.parameters, true)}, |
625 |
location.sourceStart, |
626 |
location.sourceEnd); |
627 |
} |
628 |
public void annotationCircularity(TypeBinding sourceType, TypeBinding otherType, TypeReference reference) { |
629 |
if (sourceType == otherType) |
630 |
this.handle( |
631 |
IProblem.AnnotationCircularitySelfReference, |
632 |
new String[] {new String(sourceType.readableName())}, |
633 |
new String[] {new String(sourceType.shortReadableName())}, |
634 |
reference.sourceStart, |
635 |
reference.sourceEnd); |
636 |
else |
637 |
this.handle( |
638 |
IProblem.AnnotationCircularity, |
639 |
new String[] {new String(sourceType.readableName()), new String(otherType.readableName())}, |
640 |
new String[] {new String(sourceType.shortReadableName()), new String(otherType.shortReadableName())}, |
641 |
reference.sourceStart, |
642 |
reference.sourceEnd); |
643 |
} |
644 |
public void annotationMembersCannotHaveParameters(AnnotationMethodDeclaration annotationMethodDeclaration) { |
645 |
this.handle( |
646 |
IProblem.AnnotationMembersCannotHaveParameters, |
647 |
NoArgument, |
648 |
NoArgument, |
649 |
annotationMethodDeclaration.sourceStart, |
650 |
annotationMethodDeclaration.sourceEnd); |
651 |
} |
652 |
public void annotationMembersCannotHaveTypeParameters(AnnotationMethodDeclaration annotationMethodDeclaration) { |
653 |
this.handle( |
654 |
IProblem.AnnotationMembersCannotHaveTypeParameters, |
655 |
NoArgument, |
656 |
NoArgument, |
657 |
annotationMethodDeclaration.sourceStart, |
658 |
annotationMethodDeclaration.sourceEnd); |
659 |
} |
660 |
public void annotationTypeDeclarationCannotHaveConstructor(ConstructorDeclaration constructorDeclaration) { |
661 |
this.handle( |
662 |
IProblem.AnnotationTypeDeclarationCannotHaveConstructor, |
663 |
NoArgument, |
664 |
NoArgument, |
665 |
constructorDeclaration.sourceStart, |
666 |
constructorDeclaration.sourceEnd); |
667 |
} |
668 |
public void annotationTypeDeclarationCannotHaveSuperclass(TypeDeclaration typeDeclaration) { |
669 |
this.handle( |
670 |
IProblem.AnnotationTypeDeclarationCannotHaveSuperclass, |
671 |
NoArgument, |
672 |
NoArgument, |
673 |
typeDeclaration.sourceStart, |
674 |
typeDeclaration.sourceEnd); |
675 |
} |
676 |
public void annotationTypeDeclarationCannotHaveSuperinterfaces(TypeDeclaration typeDeclaration) { |
677 |
this.handle( |
678 |
IProblem.AnnotationTypeDeclarationCannotHaveSuperinterfaces, |
679 |
NoArgument, |
680 |
NoArgument, |
681 |
typeDeclaration.sourceStart, |
682 |
typeDeclaration.sourceEnd); |
683 |
} |
684 |
public void annotationTypeUsedAsSuperinterface(SourceTypeBinding type, TypeReference superInterfaceRef, ReferenceBinding superType) { |
685 |
this.handle( |
686 |
IProblem.AnnotationTypeUsedAsSuperInterface, |
687 |
new String[] {new String(superType.readableName()), new String(type.sourceName())}, |
688 |
new String[] {new String(superType.shortReadableName()), new String(type.sourceName())}, |
689 |
superInterfaceRef.sourceStart, |
690 |
superInterfaceRef.sourceEnd); |
691 |
} |
692 |
public void annotationValueMustBeAnnotation(TypeBinding annotationType, char[] name, Expression value, TypeBinding expectedType) { |
693 |
String str = new String(name); |
694 |
this.handle( |
695 |
IProblem.AnnotationValueMustBeAnnotation, |
696 |
new String[] { new String(annotationType.readableName()), str, new String(expectedType.readableName()), }, |
697 |
new String[] { new String(annotationType.shortReadableName()), str, new String(expectedType.readableName()), }, |
698 |
value.sourceStart, |
699 |
value.sourceEnd); |
700 |
} |
701 |
public void annotationValueMustBeArrayInitializer(TypeBinding annotationType, char[] name, Expression value) { |
702 |
String str = new String(name); |
703 |
this.handle( |
704 |
IProblem.AnnotationValueMustBeArrayInitializer, |
705 |
new String[] { new String(annotationType.readableName()), str }, |
706 |
new String[] { new String(annotationType.shortReadableName()), str}, |
707 |
value.sourceStart, |
708 |
value.sourceEnd); |
709 |
} |
710 |
public void annotationValueMustBeClassLiteral(TypeBinding annotationType, char[] name, Expression value) { |
711 |
String str = new String(name); |
712 |
this.handle( |
713 |
IProblem.AnnotationValueMustBeClassLiteral, |
714 |
new String[] { new String(annotationType.readableName()), str }, |
715 |
new String[] { new String(annotationType.shortReadableName()), str}, |
716 |
value.sourceStart, |
717 |
value.sourceEnd); |
718 |
} |
719 |
public void annotationValueMustBeConstant(TypeBinding annotationType, char[] name, Expression value, boolean isEnum) { |
720 |
String str = new String(name); |
721 |
if (isEnum) { |
722 |
this.handle( |
723 |
IProblem.AnnotationValueMustBeAnEnumConstant, |
724 |
new String[] { new String(annotationType.readableName()), str }, |
725 |
new String[] { new String(annotationType.shortReadableName()), str}, |
726 |
value.sourceStart, |
727 |
value.sourceEnd); |
728 |
} else { |
729 |
this.handle( |
730 |
IProblem.AnnotationValueMustBeConstant, |
731 |
new String[] { new String(annotationType.readableName()), str }, |
732 |
new String[] { new String(annotationType.shortReadableName()), str}, |
733 |
value.sourceStart, |
734 |
value.sourceEnd); |
735 |
} |
736 |
} |
737 |
public void anonymousClassCannotExtendFinalClass(Expression expression, TypeBinding type) { |
565 |
public void anonymousClassCannotExtendFinalClass(Expression expression, TypeBinding type) { |
738 |
this.handle( |
566 |
this.handle( |
739 |
IProblem.AnonymousClassCannotExtendFinalClass, |
567 |
IProblem.AnonymousClassCannotExtendFinalClass, |
Lines 891-908
Link Here
|
891 |
messageSend.sourceStart, |
719 |
messageSend.sourceStart, |
892 |
messageSend.sourceEnd); |
720 |
messageSend.sourceEnd); |
893 |
} |
721 |
} |
894 |
public void cannotExtendEnum(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) { |
|
|
895 |
String name = new String(type.sourceName()); |
896 |
String superTypeFullName = new String(superTypeBinding.readableName()); |
897 |
String superTypeShortName = new String(superTypeBinding.shortReadableName()); |
898 |
if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName; |
899 |
this.handle( |
900 |
IProblem.CannotExtendEnum, |
901 |
new String[] {superTypeFullName, name}, |
902 |
new String[] {superTypeShortName, name}, |
903 |
superclass.sourceStart, |
904 |
superclass.sourceEnd); |
905 |
} |
906 |
public void cannotImportPackage(ImportReference importRef) { |
722 |
public void cannotImportPackage(ImportReference importRef) { |
907 |
String[] arguments = new String[] {CharOperation.toString(importRef.tokens)}; |
723 |
String[] arguments = new String[] {CharOperation.toString(importRef.tokens)}; |
908 |
this.handle( |
724 |
this.handle( |
Lines 920-939
Link Here
|
920 |
typeRef.sourceStart, |
736 |
typeRef.sourceStart, |
921 |
typeRef.sourceEnd); |
737 |
typeRef.sourceEnd); |
922 |
} |
738 |
} |
923 |
public void cannotInvokeSuperConstructorInEnum(ExplicitConstructorCall constructorCall, MethodBinding enumConstructor) { |
|
|
924 |
this.handle( |
925 |
IProblem.CannotInvokeSuperConstructorInEnum, |
926 |
new String[] { |
927 |
new String(enumConstructor.declaringClass.sourceName()), |
928 |
typesAsString(enumConstructor.isVarargs(), enumConstructor.parameters, false), |
929 |
}, |
930 |
new String[] { |
931 |
new String(enumConstructor.declaringClass.sourceName()), |
932 |
typesAsString(enumConstructor.isVarargs(), enumConstructor.parameters, true), |
933 |
}, |
934 |
constructorCall.sourceStart, |
935 |
constructorCall.sourceEnd); |
936 |
} |
937 |
public void cannotReadSource(CompilationUnitDeclaration unit, AbortCompilationUnit abortException, boolean verbose) { |
739 |
public void cannotReadSource(CompilationUnitDeclaration unit, AbortCompilationUnit abortException, boolean verbose) { |
938 |
String fileName = new String(unit.compilationResult.fileName); |
740 |
String fileName = new String(unit.compilationResult.fileName); |
939 |
if (abortException.exception instanceof CharConversionException) { |
741 |
if (abortException.exception instanceof CharConversionException) { |
Lines 1002-1015
Link Here
|
1002 |
exception.sourceStart, |
804 |
exception.sourceStart, |
1003 |
exception.sourceEnd); |
805 |
exception.sourceEnd); |
1004 |
} |
806 |
} |
1005 |
public void cannotUseQualifiedEnumConstantInCaseLabel(Reference location, FieldBinding field) { |
|
|
1006 |
this.handle( |
1007 |
IProblem.IllegalQualifiedEnumConstantLabel, |
1008 |
new String[]{ String.valueOf(field.declaringClass.readableName()), String.valueOf(field.name) }, |
1009 |
new String[]{ String.valueOf(field.declaringClass.shortReadableName()), String.valueOf(field.name) }, |
1010 |
nodeSourceStart(field, location), |
1011 |
nodeSourceEnd(field, location)); |
1012 |
} |
1013 |
public void cannotUseSuperInCodeSnippet(int start, int end) { |
807 |
public void cannotUseSuperInCodeSnippet(int start, int end) { |
1014 |
this.handle( |
808 |
this.handle( |
1015 |
IProblem.CannotUseSuperInCodeSnippet, |
809 |
IProblem.CannotUseSuperInCodeSnippet, |
Lines 1027-1040
Link Here
|
1027 |
reference.sourceStart, |
821 |
reference.sourceStart, |
1028 |
reference.sourceEnd); |
822 |
reference.sourceEnd); |
1029 |
} |
823 |
} |
1030 |
public void caseExpressionMustBeConstant(Expression expression) { |
|
|
1031 |
this.handle( |
1032 |
IProblem.NonConstantExpression, |
1033 |
NoArgument, |
1034 |
NoArgument, |
1035 |
expression.sourceStart, |
1036 |
expression.sourceEnd); |
1037 |
} |
1038 |
public void classExtendFinalClass(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) { |
824 |
public void classExtendFinalClass(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) { |
1039 |
String name = new String(type.sourceName()); |
825 |
String name = new String(type.sourceName()); |
1040 |
String superTypeFullName = new String(superTypeBinding.readableName()); |
826 |
String superTypeFullName = new String(superTypeBinding.readableName()); |
Lines 1088-1095
Link Here
|
1088 |
switch (problemID) { |
874 |
switch (problemID) { |
1089 |
case IProblem.Task : |
875 |
case IProblem.Task : |
1090 |
return ProblemSeverities.Warning; |
876 |
return ProblemSeverities.Warning; |
1091 |
case IProblem.VarargsConflict : |
|
|
1092 |
return ProblemSeverities.Warning; |
1093 |
case IProblem.TypeCollidesWithPackage : |
877 |
case IProblem.TypeCollidesWithPackage : |
1094 |
return ProblemSeverities.Warning; |
878 |
return ProblemSeverities.Warning; |
1095 |
|
879 |
|
Lines 1136-1151
Link Here
|
1136 |
case IProblem.JavadocInheritedFieldHidesEnclosingName: |
920 |
case IProblem.JavadocInheritedFieldHidesEnclosingName: |
1137 |
case IProblem.JavadocInheritedNameHidesEnclosingTypeName: |
921 |
case IProblem.JavadocInheritedNameHidesEnclosingTypeName: |
1138 |
case IProblem.JavadocNonStaticTypeFromStaticInvocation: |
922 |
case IProblem.JavadocNonStaticTypeFromStaticInvocation: |
1139 |
case IProblem.JavadocGenericMethodTypeArgumentMismatch: |
|
|
1140 |
case IProblem.JavadocNonGenericMethod: |
1141 |
case IProblem.JavadocIncorrectArityForParameterizedMethod: |
1142 |
case IProblem.JavadocParameterizedMethodArgumentTypeMismatch: |
1143 |
case IProblem.JavadocTypeArgumentsForRawGenericMethod: |
1144 |
case IProblem.JavadocGenericConstructorTypeArgumentMismatch: |
1145 |
case IProblem.JavadocNonGenericConstructor: |
1146 |
case IProblem.JavadocIncorrectArityForParameterizedConstructor: |
1147 |
case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch: |
1148 |
case IProblem.JavadocTypeArgumentsForRawGenericConstructor: |
1149 |
case IProblem.JavadocEmptyReturnTag: |
923 |
case IProblem.JavadocEmptyReturnTag: |
1150 |
if (!this.options.reportInvalidJavadocTags) { |
924 |
if (!this.options.reportInvalidJavadocTags) { |
1151 |
return ProblemSeverities.Ignore; |
925 |
return ProblemSeverities.Ignore; |
Lines 1309-1339
Link Here
|
1309 |
location.sourceStart, |
1083 |
location.sourceStart, |
1310 |
nodeSourceEnd(null, location)); |
1084 |
nodeSourceEnd(null, location)); |
1311 |
} |
1085 |
} |
1312 |
public void disallowedTargetForAnnotation(Annotation annotation) { |
|
|
1313 |
this.handle( |
1314 |
IProblem.DisallowedTargetForAnnotation, |
1315 |
new String[] {new String(annotation.resolvedType.readableName())}, |
1316 |
new String[] {new String(annotation.resolvedType.shortReadableName())}, |
1317 |
annotation.sourceStart, |
1318 |
annotation.sourceEnd); |
1319 |
} |
1320 |
public void duplicateAnnotation(Annotation annotation) { |
1321 |
this.handle( |
1322 |
IProblem.DuplicateAnnotation, |
1323 |
new String[] {new String(annotation.resolvedType.readableName())}, |
1324 |
new String[] {new String(annotation.resolvedType.shortReadableName())}, |
1325 |
annotation.sourceStart, |
1326 |
annotation.sourceEnd); |
1327 |
} |
1328 |
public void duplicateAnnotationValue(TypeBinding annotationType, MemberValuePair memberValuePair) { |
1329 |
String name = new String(memberValuePair.name); |
1330 |
this.handle( |
1331 |
IProblem.DuplicateAnnotationMember, |
1332 |
new String[] { name, new String(annotationType.readableName())}, |
1333 |
new String[] { name, new String(annotationType.shortReadableName())}, |
1334 |
memberValuePair.sourceStart, |
1335 |
memberValuePair.sourceEnd); |
1336 |
} |
1337 |
public void duplicateBounds(ASTNode location, TypeBinding type) { |
1086 |
public void duplicateBounds(ASTNode location, TypeBinding type) { |
1338 |
this.handle( |
1087 |
this.handle( |
1339 |
IProblem.DuplicateBounds, |
1088 |
IProblem.DuplicateBounds, |
Lines 1358-1379
Link Here
|
1358 |
statement.sourceStart, |
1107 |
statement.sourceStart, |
1359 |
statement.sourceEnd); |
1108 |
statement.sourceEnd); |
1360 |
} |
1109 |
} |
1361 |
|
|
|
1362 |
public void duplicateEnumSpecialMethod(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) { |
1363 |
MethodBinding method = methodDecl.binding; |
1364 |
this.handle( |
1365 |
IProblem.CannotDeclareEnumSpecialMethod, |
1366 |
new String[] { |
1367 |
new String(methodDecl.getSafeName()), |
1368 |
new String(method.declaringClass.readableName()), |
1369 |
typesAsString(method.isVarargs(), method.parameters, false)}, |
1370 |
new String[] { |
1371 |
new String(methodDecl.getSafeName()), |
1372 |
new String(method.declaringClass.shortReadableName()), |
1373 |
typesAsString(method.isVarargs(), method.parameters, true)}, |
1374 |
methodDecl.sourceStart, |
1375 |
methodDecl.sourceEnd); |
1376 |
} |
1377 |
public void duplicateFieldInType(SourceTypeBinding type, FieldDeclaration fieldDecl) { |
1110 |
public void duplicateFieldInType(SourceTypeBinding type, FieldDeclaration fieldDecl) { |
1378 |
this.handle( |
1111 |
this.handle( |
1379 |
IProblem.DuplicateField, |
1112 |
IProblem.DuplicateField, |
Lines 1549-1564
Link Here
|
1549 |
reference.sourceStart, |
1282 |
reference.sourceStart, |
1550 |
reference.sourceEnd); |
1283 |
reference.sourceEnd); |
1551 |
} |
1284 |
} |
1552 |
public void duplicateTargetInTargetAnnotation(TypeBinding annotationType, NameReference reference) { |
|
|
1553 |
FieldBinding field = reference.fieldBinding(); |
1554 |
String name = new String(field.name); |
1555 |
this.handle( |
1556 |
IProblem.DuplicateTargetInTargetAnnotation, |
1557 |
new String[] { name, new String(annotationType.readableName())}, |
1558 |
new String[] { name, new String(annotationType.shortReadableName())}, |
1559 |
nodeSourceStart(field, reference), |
1560 |
nodeSourceEnd(field, reference)); |
1561 |
} |
1562 |
public void duplicateTypeParameterInType(TypeParameter typeParameter) { |
1285 |
public void duplicateTypeParameterInType(TypeParameter typeParameter) { |
1563 |
this.handle( |
1286 |
this.handle( |
1564 |
IProblem.DuplicateTypeVariable, |
1287 |
IProblem.DuplicateTypeVariable, |
Lines 1597-1624
Link Here
|
1597 |
sourceStart, |
1320 |
sourceStart, |
1598 |
sourceEnd); |
1321 |
sourceEnd); |
1599 |
} |
1322 |
} |
1600 |
public void enumAbstractMethodMustBeImplemented(AbstractMethodDeclaration method) { |
|
|
1601 |
MethodBinding abstractMethod = method.binding; |
1602 |
char[] methodSelector = abstractMethod.selector; |
1603 |
if(methodSelector == null) |
1604 |
methodSelector = method.getSafeName(); |
1605 |
this.handle( |
1606 |
// Must implement the inherited abstract method %1 |
1607 |
// 8.4.3 - Every non-abstract subclass of an abstract type, A, must provide a concrete implementation of all of A's methods. |
1608 |
IProblem.EnumAbstractMethodMustBeImplemented, |
1609 |
new String[] { |
1610 |
new String(methodSelector), |
1611 |
typesAsString(abstractMethod.isVarargs(), abstractMethod.parameters, false), |
1612 |
new String(abstractMethod.declaringClass.readableName()), |
1613 |
}, |
1614 |
new String[] { |
1615 |
new String(methodSelector), |
1616 |
typesAsString(abstractMethod.isVarargs(), abstractMethod.parameters, true), |
1617 |
new String(abstractMethod.declaringClass.shortReadableName()), |
1618 |
}, |
1619 |
method.sourceStart(), |
1620 |
method.sourceEnd()); |
1621 |
} |
1622 |
public void enumConstantsCannotBeSurroundedByParenthesis(Expression expression) { |
1323 |
public void enumConstantsCannotBeSurroundedByParenthesis(Expression expression) { |
1623 |
this.handle( |
1324 |
this.handle( |
1624 |
IProblem.EnumConstantsCannotBeSurroundedByParenthesis, |
1325 |
IProblem.EnumConstantsCannotBeSurroundedByParenthesis, |
Lines 1627-1648
Link Here
|
1627 |
expression.sourceStart, |
1328 |
expression.sourceStart, |
1628 |
expression.sourceEnd); |
1329 |
expression.sourceEnd); |
1629 |
} |
1330 |
} |
1630 |
public void enumStaticFieldUsedDuringInitialization(FieldBinding field, ASTNode location) { |
|
|
1631 |
this.handle( |
1632 |
IProblem.EnumStaticFieldInInInitializerContext, |
1633 |
new String[] {new String(field.declaringClass.readableName()), new String(field.name)}, |
1634 |
new String[] {new String(field.declaringClass.shortReadableName()), new String(field.name)}, |
1635 |
nodeSourceStart(field, location), |
1636 |
nodeSourceEnd(field, location)); |
1637 |
} |
1638 |
public void enumSwitchCannotTargetField(Reference reference, FieldBinding field) { |
1639 |
this.handle( |
1640 |
IProblem.EnumSwitchCannotTargetField, |
1641 |
new String[]{ String.valueOf(field.declaringClass.readableName()), String.valueOf(field.name) }, |
1642 |
new String[]{ String.valueOf(field.declaringClass.shortReadableName()), String.valueOf(field.name) }, |
1643 |
nodeSourceStart(field, reference), |
1644 |
nodeSourceEnd(field, reference)); |
1645 |
} |
1646 |
public void errorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params) { |
1331 |
public void errorNoMethodFor(MessageSend messageSend, TypeBinding recType, TypeBinding[] params) { |
1647 |
StringBuffer buffer = new StringBuffer(); |
1332 |
StringBuffer buffer = new StringBuffer(); |
1648 |
StringBuffer shortBuffer = new StringBuffer(); |
1333 |
StringBuffer shortBuffer = new StringBuffer(); |
Lines 1975-1996
Link Here
|
1975 |
location.sourceStart, |
1660 |
location.sourceStart, |
1976 |
location.sourceEnd); |
1661 |
location.sourceEnd); |
1977 |
} |
1662 |
} |
1978 |
public void illegalExtendedDimensions(AnnotationMethodDeclaration annotationTypeMemberDeclaration) { |
|
|
1979 |
this.handle( |
1980 |
IProblem.IllegalExtendedDimensions, |
1981 |
NoArgument, |
1982 |
NoArgument, |
1983 |
annotationTypeMemberDeclaration.sourceStart, |
1984 |
annotationTypeMemberDeclaration.sourceEnd); |
1985 |
} |
1986 |
public void illegalExtendedDimensions(Argument argument) { |
1987 |
this.handle( |
1988 |
IProblem.IllegalExtendedDimensionsForVarArgs, |
1989 |
NoArgument, |
1990 |
NoArgument, |
1991 |
argument.sourceStart, |
1992 |
argument.sourceEnd); |
1993 |
} |
1994 |
public void illegalGenericArray(TypeBinding leafComponentType, ASTNode location) { |
1663 |
public void illegalGenericArray(TypeBinding leafComponentType, ASTNode location) { |
1995 |
this.handle( |
1664 |
this.handle( |
1996 |
IProblem.IllegalGenericArray, |
1665 |
IProblem.IllegalGenericArray, |
Lines 1999-2021
Link Here
|
1999 |
location.sourceStart, |
1668 |
location.sourceStart, |
2000 |
location.sourceEnd); |
1669 |
location.sourceEnd); |
2001 |
} |
1670 |
} |
2002 |
public void illegalInstanceOfGenericType(TypeBinding checkedType, ASTNode location) { |
|
|
2003 |
if (checkedType.isTypeVariable()) { |
2004 |
this.handle( |
2005 |
IProblem.IllegalInstanceofTypeParameter, |
2006 |
new String[] { new String(checkedType.readableName()), new String(checkedType.erasure().readableName())}, |
2007 |
new String[] { new String(checkedType.shortReadableName()), new String(checkedType.erasure().shortReadableName())}, |
2008 |
location.sourceStart, |
2009 |
location.sourceEnd); |
2010 |
return; |
2011 |
} |
2012 |
this.handle( |
2013 |
IProblem.IllegalInstanceofParameterizedType, |
2014 |
new String[] { new String(checkedType.readableName()), new String(checkedType.erasure().sourceName())}, |
2015 |
new String[] { new String(checkedType.shortReadableName()), new String(checkedType.erasure().sourceName())}, |
2016 |
location.sourceStart, |
2017 |
location.sourceEnd); |
2018 |
} |
2019 |
public void illegalLocalTypeDeclaration(TypeDeclaration typeDeclaration) { |
1671 |
public void illegalLocalTypeDeclaration(TypeDeclaration typeDeclaration) { |
2020 |
if (isRecoveredName(typeDeclaration.name)) return; |
1672 |
if (isRecoveredName(typeDeclaration.name)) return; |
2021 |
|
1673 |
|
Lines 2056-2108
Link Here
|
2056 |
fieldDecl.sourceStart, |
1708 |
fieldDecl.sourceStart, |
2057 |
fieldDecl.sourceEnd); |
1709 |
fieldDecl.sourceEnd); |
2058 |
} |
1710 |
} |
2059 |
public void illegalModifierForAnnotationField(FieldDeclaration fieldDecl) { |
|
|
2060 |
String name = new String(fieldDecl.name); |
2061 |
this.handle( |
2062 |
IProblem.IllegalModifierForAnnotationField, |
2063 |
new String[] { |
2064 |
new String(fieldDecl.binding.declaringClass.readableName()), |
2065 |
name, |
2066 |
}, |
2067 |
new String[] { |
2068 |
new String(fieldDecl.binding.declaringClass.shortReadableName()), |
2069 |
name, |
2070 |
}, |
2071 |
fieldDecl.sourceStart, |
2072 |
fieldDecl.sourceEnd); |
2073 |
} |
2074 |
public void illegalModifierForAnnotationMember(AbstractMethodDeclaration methodDecl) { |
2075 |
this.handle( |
2076 |
IProblem.IllegalModifierForAnnotationMethod, |
2077 |
new String[] { |
2078 |
new String(methodDecl.binding.declaringClass.readableName()), |
2079 |
new String(methodDecl.getSafeName()), |
2080 |
}, |
2081 |
new String[] { |
2082 |
new String(methodDecl.binding.declaringClass.shortReadableName()), |
2083 |
new String(methodDecl.getSafeName()), |
2084 |
}, |
2085 |
methodDecl.sourceStart, |
2086 |
methodDecl.sourceEnd); |
2087 |
} |
2088 |
public void illegalModifierForAnnotationMemberType(SourceTypeBinding type) { |
2089 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2090 |
this.handle( |
2091 |
IProblem.IllegalModifierForAnnotationMemberType, |
2092 |
arguments, |
2093 |
arguments, |
2094 |
type.sourceStart(), |
2095 |
type.sourceEnd()); |
2096 |
} |
2097 |
public void illegalModifierForAnnotationType(SourceTypeBinding type) { |
2098 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2099 |
this.handle( |
2100 |
IProblem.IllegalModifierForAnnotationType, |
2101 |
arguments, |
2102 |
arguments, |
2103 |
type.sourceStart(), |
2104 |
type.sourceEnd()); |
2105 |
} |
2106 |
public void illegalModifierForClass(SourceTypeBinding type) { |
1711 |
public void illegalModifierForClass(SourceTypeBinding type) { |
2107 |
String[] arguments = new String[] {new String(type.sourceName())}; |
1712 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2108 |
this.handle( |
1713 |
this.handle( |
Lines 2112-2144
Link Here
|
2112 |
type.sourceStart(), |
1717 |
type.sourceStart(), |
2113 |
type.sourceEnd()); |
1718 |
type.sourceEnd()); |
2114 |
} |
1719 |
} |
2115 |
public void illegalModifierForEnum(SourceTypeBinding type) { |
|
|
2116 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2117 |
this.handle( |
2118 |
IProblem.IllegalModifierForEnum, |
2119 |
arguments, |
2120 |
arguments, |
2121 |
type.sourceStart(), |
2122 |
type.sourceEnd()); |
2123 |
} |
2124 |
public void illegalModifierForEnumConstant(ReferenceBinding type, FieldDeclaration fieldDecl) { |
2125 |
String[] arguments = new String[] {new String(fieldDecl.name)}; |
2126 |
this.handle( |
2127 |
IProblem.IllegalModifierForEnumConstant, |
2128 |
arguments, |
2129 |
arguments, |
2130 |
fieldDecl.sourceStart, |
2131 |
fieldDecl.sourceEnd); |
2132 |
} |
2133 |
|
2134 |
public void illegalModifierForEnumConstructor(AbstractMethodDeclaration constructor) { |
2135 |
this.handle( |
2136 |
IProblem.IllegalModifierForEnumConstructor, |
2137 |
NoArgument, |
2138 |
NoArgument, |
2139 |
constructor.sourceStart, |
2140 |
constructor.sourceEnd); |
2141 |
} |
2142 |
public void illegalModifierForField(ReferenceBinding type, FieldDeclaration fieldDecl) { |
1720 |
public void illegalModifierForField(ReferenceBinding type, FieldDeclaration fieldDecl) { |
2143 |
String[] arguments = new String[] {new String(fieldDecl.name)}; |
1721 |
String[] arguments = new String[] {new String(fieldDecl.name)}; |
2144 |
this.handle( |
1722 |
this.handle( |
Lines 2198-2212
Link Here
|
2198 |
type.sourceStart(), |
1776 |
type.sourceStart(), |
2199 |
type.sourceEnd()); |
1777 |
type.sourceEnd()); |
2200 |
} |
1778 |
} |
2201 |
public void illegalModifierForLocalEnum(SourceTypeBinding type) { |
|
|
2202 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2203 |
this.handle( |
2204 |
IProblem.IllegalModifierForLocalEnum, |
2205 |
arguments, |
2206 |
arguments, |
2207 |
type.sourceStart(), |
2208 |
type.sourceEnd()); |
2209 |
} |
2210 |
public void illegalModifierForMemberClass(SourceTypeBinding type) { |
1779 |
public void illegalModifierForMemberClass(SourceTypeBinding type) { |
2211 |
String[] arguments = new String[] {new String(type.sourceName())}; |
1780 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2212 |
this.handle( |
1781 |
this.handle( |
Lines 2216-2230
Link Here
|
2216 |
type.sourceStart(), |
1785 |
type.sourceStart(), |
2217 |
type.sourceEnd()); |
1786 |
type.sourceEnd()); |
2218 |
} |
1787 |
} |
2219 |
public void illegalModifierForMemberEnum(SourceTypeBinding type) { |
|
|
2220 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2221 |
this.handle( |
2222 |
IProblem.IllegalModifierForMemberEnum, |
2223 |
arguments, |
2224 |
arguments, |
2225 |
type.sourceStart(), |
2226 |
type.sourceEnd()); |
2227 |
} |
2228 |
public void illegalModifierForMemberInterface(SourceTypeBinding type) { |
1788 |
public void illegalModifierForMemberInterface(SourceTypeBinding type) { |
2229 |
String[] arguments = new String[] {new String(type.sourceName())}; |
1789 |
String[] arguments = new String[] {new String(type.sourceName())}; |
2230 |
this.handle( |
1790 |
this.handle( |
Lines 2720-2742
Link Here
|
2720 |
fieldDecl.sourceStart, |
2280 |
fieldDecl.sourceStart, |
2721 |
fieldDecl.sourceEnd); |
2281 |
fieldDecl.sourceEnd); |
2722 |
} |
2282 |
} |
2723 |
public void invalidAnnotationMemberType(MethodDeclaration methodDecl) { |
|
|
2724 |
this.handle( |
2725 |
IProblem.InvalidAnnotationMemberType, |
2726 |
new String[] { |
2727 |
new String(methodDecl.binding.returnType.readableName()), |
2728 |
new String(methodDecl.getSafeName()), |
2729 |
new String(methodDecl.binding.declaringClass.readableName()), |
2730 |
}, |
2731 |
new String[] { |
2732 |
new String(methodDecl.binding.returnType.shortReadableName()), |
2733 |
new String(methodDecl.getSafeName()), |
2734 |
new String(methodDecl.binding.declaringClass.shortReadableName()), |
2735 |
}, |
2736 |
methodDecl.returnType.sourceStart, |
2737 |
methodDecl.returnType.sourceEnd); |
2738 |
|
2739 |
} |
2740 |
public void invalidBreak(ASTNode location) { |
2283 |
public void invalidBreak(ASTNode location) { |
2741 |
this.handle( |
2284 |
this.handle( |
2742 |
IProblem.InvalidBreak, |
2285 |
IProblem.InvalidBreak, |
Lines 2797-2908
Link Here
|
2797 |
id = IProblem.AmbiguousConstructor; |
2340 |
id = IProblem.AmbiguousConstructor; |
2798 |
} |
2341 |
} |
2799 |
break; |
2342 |
break; |
2800 |
case ProblemReasons.ParameterBoundMismatch : |
|
|
2801 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
2802 |
ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch; |
2803 |
shownConstructor = substitutedConstructor.original(); |
2804 |
int augmentedLength = problemConstructor.parameters.length; |
2805 |
TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2]; |
2806 |
TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1]; |
2807 |
TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end |
2808 |
System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2); |
2809 |
this.handle( |
2810 |
IProblem.GenericConstructorTypeArgumentMismatch, |
2811 |
new String[] { |
2812 |
new String(shownConstructor.declaringClass.sourceName()), |
2813 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
2814 |
new String(shownConstructor.declaringClass.readableName()), |
2815 |
typesAsString(false, invocationArguments, false), |
2816 |
new String(inferredTypeArgument.readableName()), |
2817 |
new String(typeParameter.sourceName), |
2818 |
parameterBoundAsString(typeParameter, false) }, |
2819 |
new String[] { |
2820 |
new String(shownConstructor.declaringClass.sourceName()), |
2821 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
2822 |
new String(shownConstructor.declaringClass.shortReadableName()), |
2823 |
typesAsString(false, invocationArguments, true), |
2824 |
new String(inferredTypeArgument.shortReadableName()), |
2825 |
new String(typeParameter.sourceName), |
2826 |
parameterBoundAsString(typeParameter, true) }, |
2827 |
sourceStart, |
2828 |
sourceEnd); |
2829 |
return; |
2830 |
|
2343 |
|
2831 |
case ProblemReasons.TypeParameterArityMismatch : |
|
|
2832 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
2833 |
shownConstructor = problemConstructor.closestMatch; |
2834 |
if (shownConstructor.typeVariables == Binding.NO_TYPE_VARIABLES) { |
2835 |
this.handle( |
2836 |
IProblem.NonGenericConstructor, |
2837 |
new String[] { |
2838 |
new String(shownConstructor.declaringClass.sourceName()), |
2839 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
2840 |
new String(shownConstructor.declaringClass.readableName()), |
2841 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
2842 |
new String[] { |
2843 |
new String(shownConstructor.declaringClass.sourceName()), |
2844 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
2845 |
new String(shownConstructor.declaringClass.shortReadableName()), |
2846 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
2847 |
sourceStart, |
2848 |
sourceEnd); |
2849 |
} else { |
2850 |
this.handle( |
2851 |
IProblem.IncorrectArityForParameterizedConstructor , |
2852 |
new String[] { |
2853 |
new String(shownConstructor.declaringClass.sourceName()), |
2854 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
2855 |
new String(shownConstructor.declaringClass.readableName()), |
2856 |
typesAsString(false, shownConstructor.typeVariables, false), |
2857 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
2858 |
new String[] { |
2859 |
new String(shownConstructor.declaringClass.sourceName()), |
2860 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
2861 |
new String(shownConstructor.declaringClass.shortReadableName()), |
2862 |
typesAsString(false, shownConstructor.typeVariables, true), |
2863 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
2864 |
sourceStart, |
2865 |
sourceEnd); |
2866 |
} |
2867 |
return; |
2868 |
case ProblemReasons.ParameterizedMethodTypeMismatch : |
2869 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
2870 |
shownConstructor = problemConstructor.closestMatch; |
2871 |
this.handle( |
2872 |
IProblem.ParameterizedConstructorArgumentTypeMismatch, |
2873 |
new String[] { |
2874 |
new String(shownConstructor.declaringClass.sourceName()), |
2875 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
2876 |
new String(shownConstructor.declaringClass.readableName()), |
2877 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, false), |
2878 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
2879 |
new String[] { |
2880 |
new String(shownConstructor.declaringClass.sourceName()), |
2881 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
2882 |
new String(shownConstructor.declaringClass.shortReadableName()), |
2883 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, true), |
2884 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
2885 |
sourceStart, |
2886 |
sourceEnd); |
2887 |
return; |
2888 |
case ProblemReasons.TypeArgumentsForRawGenericMethod : |
2889 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
2890 |
shownConstructor = problemConstructor.closestMatch; |
2891 |
this.handle( |
2892 |
IProblem.TypeArgumentsForRawGenericConstructor, |
2893 |
new String[] { |
2894 |
new String(shownConstructor.declaringClass.sourceName()), |
2895 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
2896 |
new String(shownConstructor.declaringClass.readableName()), |
2897 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
2898 |
new String[] { |
2899 |
new String(shownConstructor.declaringClass.sourceName()), |
2900 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
2901 |
new String(shownConstructor.declaringClass.shortReadableName()), |
2902 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
2903 |
sourceStart, |
2904 |
sourceEnd); |
2905 |
return; |
2906 |
case ProblemReasons.NoError : // 0 |
2344 |
case ProblemReasons.NoError : // 0 |
2907 |
default : |
2345 |
default : |
2908 |
needImplementation(); // want to fail to see why we were here... |
2346 |
needImplementation(); // want to fail to see why we were here... |
Lines 3163-3176
Link Here
|
3163 |
nameRef.sourceStart, |
2601 |
nameRef.sourceStart, |
3164 |
(int) nameRef.sourcePositions[index]); |
2602 |
(int) nameRef.sourcePositions[index]); |
3165 |
} |
2603 |
} |
3166 |
public void invalidFileNameForPackageAnnotations(Annotation annotation) { |
|
|
3167 |
this.handle( |
3168 |
IProblem.InvalidFileNameForPackageAnnotations, |
3169 |
NoArgument, |
3170 |
NoArgument, |
3171 |
annotation.sourceStart, |
3172 |
annotation.sourceEnd); |
3173 |
} |
3174 |
public void invalidMethod(MessageSend messageSend, MethodBinding method) { |
2604 |
public void invalidMethod(MessageSend messageSend, MethodBinding method) { |
3175 |
if (isRecoveredName(messageSend.selector)) return; |
2605 |
if (isRecoveredName(messageSend.selector)) return; |
3176 |
|
2606 |
|
Lines 3237-3347
Link Here
|
3237 |
messageSend.receiver.sourceStart, |
2667 |
messageSend.receiver.sourceStart, |
3238 |
messageSend.receiver.sourceEnd); |
2668 |
messageSend.receiver.sourceEnd); |
3239 |
return; |
2669 |
return; |
3240 |
case ProblemReasons.ParameterBoundMismatch : |
|
|
3241 |
problemMethod = (ProblemMethodBinding) method; |
3242 |
ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch; |
3243 |
shownMethod = substitutedMethod.original(); |
3244 |
int augmentedLength = problemMethod.parameters.length; |
3245 |
TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2]; |
3246 |
TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1]; |
3247 |
TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end |
3248 |
System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2); |
3249 |
this.handle( |
3250 |
IProblem.GenericMethodTypeArgumentMismatch, |
3251 |
new String[] { |
3252 |
new String(shownMethod.selector), |
3253 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
3254 |
new String(shownMethod.declaringClass.readableName()), |
3255 |
typesAsString(false, invocationArguments, false), |
3256 |
new String(inferredTypeArgument.readableName()), |
3257 |
new String(typeParameter.sourceName), |
3258 |
parameterBoundAsString(typeParameter, false) }, |
3259 |
new String[] { |
3260 |
new String(shownMethod.selector), |
3261 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
3262 |
new String(shownMethod.declaringClass.shortReadableName()), |
3263 |
typesAsString(false, invocationArguments, true), |
3264 |
new String(inferredTypeArgument.shortReadableName()), |
3265 |
new String(typeParameter.sourceName), |
3266 |
parameterBoundAsString(typeParameter, true) }, |
3267 |
(int) (messageSend.nameSourcePosition >>> 32), |
3268 |
(int) messageSend.nameSourcePosition); |
3269 |
return; |
3270 |
case ProblemReasons.TypeParameterArityMismatch : |
3271 |
problemMethod = (ProblemMethodBinding) method; |
3272 |
shownMethod = problemMethod.closestMatch; |
3273 |
if (shownMethod.typeVariables == Binding.NO_TYPE_VARIABLES) { |
3274 |
this.handle( |
3275 |
IProblem.NonGenericMethod , |
3276 |
new String[] { |
3277 |
new String(shownMethod.selector), |
3278 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
3279 |
new String(shownMethod.declaringClass.readableName()), |
3280 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
3281 |
new String[] { |
3282 |
new String(shownMethod.selector), |
3283 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
3284 |
new String(shownMethod.declaringClass.shortReadableName()), |
3285 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
3286 |
(int) (messageSend.nameSourcePosition >>> 32), |
3287 |
(int) messageSend.nameSourcePosition); |
3288 |
} else { |
3289 |
this.handle( |
3290 |
IProblem.IncorrectArityForParameterizedMethod , |
3291 |
new String[] { |
3292 |
new String(shownMethod.selector), |
3293 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
3294 |
new String(shownMethod.declaringClass.readableName()), |
3295 |
typesAsString(false, shownMethod.typeVariables, false), |
3296 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
3297 |
new String[] { |
3298 |
new String(shownMethod.selector), |
3299 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
3300 |
new String(shownMethod.declaringClass.shortReadableName()), |
3301 |
typesAsString(false, shownMethod.typeVariables, true), |
3302 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
3303 |
(int) (messageSend.nameSourcePosition >>> 32), |
3304 |
(int) messageSend.nameSourcePosition); |
3305 |
} |
3306 |
return; |
3307 |
case ProblemReasons.ParameterizedMethodTypeMismatch : |
3308 |
problemMethod = (ProblemMethodBinding) method; |
3309 |
shownMethod = problemMethod.closestMatch; |
3310 |
this.handle( |
3311 |
IProblem.ParameterizedMethodArgumentTypeMismatch, |
3312 |
new String[] { |
3313 |
new String(shownMethod.selector), |
3314 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
3315 |
new String(shownMethod.declaringClass.readableName()), |
3316 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, false), |
3317 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
3318 |
new String[] { |
3319 |
new String(shownMethod.selector), |
3320 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
3321 |
new String(shownMethod.declaringClass.shortReadableName()), |
3322 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, true), |
3323 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
3324 |
(int) (messageSend.nameSourcePosition >>> 32), |
3325 |
(int) messageSend.nameSourcePosition); |
3326 |
return; |
3327 |
case ProblemReasons.TypeArgumentsForRawGenericMethod : |
3328 |
problemMethod = (ProblemMethodBinding) method; |
3329 |
shownMethod = problemMethod.closestMatch; |
3330 |
this.handle( |
3331 |
IProblem.TypeArgumentsForRawGenericMethod , |
3332 |
new String[] { |
3333 |
new String(shownMethod.selector), |
3334 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
3335 |
new String(shownMethod.declaringClass.readableName()), |
3336 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
3337 |
new String[] { |
3338 |
new String(shownMethod.selector), |
3339 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
3340 |
new String(shownMethod.declaringClass.shortReadableName()), |
3341 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
3342 |
(int) (messageSend.nameSourcePosition >>> 32), |
3343 |
(int) messageSend.nameSourcePosition); |
3344 |
return; |
3345 |
case ProblemReasons.NoError : // 0 |
2670 |
case ProblemReasons.NoError : // 0 |
3346 |
default : |
2671 |
default : |
3347 |
needImplementation(); // want to fail to see why we were here... |
2672 |
needImplementation(); // want to fail to see why we were here... |
Lines 3602-3631
Link Here
|
3602 |
expression.sourceStart, |
2927 |
expression.sourceStart, |
3603 |
expression.sourceEnd); |
2928 |
expression.sourceEnd); |
3604 |
} |
2929 |
} |
3605 |
public void invalidUsageOfAnnotation(Annotation annotation) { |
|
|
3606 |
this.handle( |
3607 |
IProblem.InvalidUsageOfAnnotations, |
3608 |
NoArgument, |
3609 |
NoArgument, |
3610 |
annotation.sourceStart, |
3611 |
annotation.sourceEnd); |
3612 |
} |
3613 |
public void invalidUsageOfAnnotationDeclarations(TypeDeclaration annotationTypeDeclaration) { |
3614 |
this.handle( |
3615 |
IProblem.InvalidUsageOfAnnotationDeclarations, |
3616 |
NoArgument, |
3617 |
NoArgument, |
3618 |
annotationTypeDeclaration.sourceStart, |
3619 |
annotationTypeDeclaration.sourceEnd); |
3620 |
} |
3621 |
public void invalidUsageOfEnumDeclarations(TypeDeclaration enumDeclaration) { |
3622 |
this.handle( |
3623 |
IProblem.InvalidUsageOfEnumDeclarations, |
3624 |
NoArgument, |
3625 |
NoArgument, |
3626 |
enumDeclaration.sourceStart, |
3627 |
enumDeclaration.sourceEnd); |
3628 |
} |
3629 |
public void invalidUsageOfForeachStatements(LocalDeclaration elementVariable, Expression collection) { |
2930 |
public void invalidUsageOfForeachStatements(LocalDeclaration elementVariable, Expression collection) { |
3630 |
this.handle( |
2931 |
this.handle( |
3631 |
IProblem.InvalidUsageOfForeachStatements, |
2932 |
IProblem.InvalidUsageOfForeachStatements, |
Lines 3634-3655
Link Here
|
3634 |
elementVariable.declarationSourceStart, |
2935 |
elementVariable.declarationSourceStart, |
3635 |
collection.sourceEnd); |
2936 |
collection.sourceEnd); |
3636 |
} |
2937 |
} |
3637 |
public void invalidUsageOfStaticImports(ImportReference staticImport) { |
|
|
3638 |
this.handle( |
3639 |
IProblem.InvalidUsageOfStaticImports, |
3640 |
NoArgument, |
3641 |
NoArgument, |
3642 |
staticImport.declarationSourceStart, |
3643 |
staticImport.declarationSourceEnd); |
3644 |
} |
3645 |
public void invalidUsageOfTypeArguments(TypeReference firstTypeReference, TypeReference lastTypeReference) { |
3646 |
this.handle( |
3647 |
IProblem.InvalidUsageOfTypeArguments, |
3648 |
NoArgument, |
3649 |
NoArgument, |
3650 |
firstTypeReference.sourceStart, |
3651 |
lastTypeReference.sourceEnd); |
3652 |
} |
3653 |
public void invalidUsageOfTypeParameters(TypeParameter firstTypeParameter, TypeParameter lastTypeParameter) { |
2938 |
public void invalidUsageOfTypeParameters(TypeParameter firstTypeParameter, TypeParameter lastTypeParameter) { |
3654 |
this.handle( |
2939 |
this.handle( |
3655 |
IProblem.InvalidUsageOfTypeParameters, |
2940 |
IProblem.InvalidUsageOfTypeParameters, |
Lines 3658-3679
Link Here
|
3658 |
firstTypeParameter.declarationSourceStart, |
2943 |
firstTypeParameter.declarationSourceStart, |
3659 |
lastTypeParameter.declarationSourceEnd); |
2944 |
lastTypeParameter.declarationSourceEnd); |
3660 |
} |
2945 |
} |
3661 |
public void invalidUsageOfVarargs(Argument argument) { |
|
|
3662 |
this.handle( |
3663 |
IProblem.InvalidUsageOfVarargs, |
3664 |
NoArgument, |
3665 |
NoArgument, |
3666 |
argument.type.sourceStart, |
3667 |
argument.sourceEnd); |
3668 |
} |
3669 |
public void illegalUsageOfWildcard(TypeReference wildcard) { |
3670 |
this.handle( |
3671 |
IProblem.InvalidUsageOfWildcard, |
3672 |
NoArgument, |
3673 |
NoArgument, |
3674 |
wildcard.sourceStart, |
3675 |
wildcard.sourceEnd); |
3676 |
} |
3677 |
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) { |
2946 |
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) { |
3678 |
this.referenceContext = compUnitDecl; |
2947 |
this.referenceContext = compUnitDecl; |
3679 |
String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)}; |
2948 |
String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)}; |
Lines 3944-3961
Link Here
|
3944 |
public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) { |
3213 |
public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) { |
3945 |
|
3214 |
|
3946 |
if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return; |
3215 |
if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return; |
3947 |
int sourceStart = statement.sourceStart; |
|
|
3948 |
int sourceEnd = statement.sourceEnd; |
3949 |
if (statement instanceof AllocationExpression) { |
3950 |
AllocationExpression allocation = (AllocationExpression)statement; |
3951 |
if (allocation.enumConstant != null) { |
3952 |
sourceStart = allocation.enumConstant.sourceStart; |
3953 |
sourceEnd = allocation.enumConstant.sourceEnd; |
3954 |
} |
3955 |
} |
3956 |
int id = IProblem.JavadocUndefinedConstructor; //default... |
3216 |
int id = IProblem.JavadocUndefinedConstructor; //default... |
3957 |
ProblemMethodBinding problemConstructor = null; |
|
|
3958 |
MethodBinding shownConstructor = null; |
3959 |
switch (targetConstructor.problemId()) { |
3217 |
switch (targetConstructor.problemId()) { |
3960 |
case ProblemReasons.NotFound : |
3218 |
case ProblemReasons.NotFound : |
3961 |
id = IProblem.JavadocUndefinedConstructor; |
3219 |
id = IProblem.JavadocUndefinedConstructor; |
Lines 3966-4093
Link Here
|
3966 |
case ProblemReasons.Ambiguous : |
3224 |
case ProblemReasons.Ambiguous : |
3967 |
id = IProblem.JavadocAmbiguousConstructor; |
3225 |
id = IProblem.JavadocAmbiguousConstructor; |
3968 |
break; |
3226 |
break; |
3969 |
case ProblemReasons.ParameterBoundMismatch : |
|
|
3970 |
int severity = computeSeverity(IProblem.JavadocGenericConstructorTypeArgumentMismatch); |
3971 |
if (severity == ProblemSeverities.Ignore) return; |
3972 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
3973 |
ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch; |
3974 |
shownConstructor = substitutedConstructor.original(); |
3975 |
|
3976 |
int augmentedLength = problemConstructor.parameters.length; |
3977 |
TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2]; |
3978 |
TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1]; |
3979 |
TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end |
3980 |
System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2); |
3981 |
|
3982 |
this.handle( |
3983 |
IProblem.JavadocGenericConstructorTypeArgumentMismatch, |
3984 |
new String[] { |
3985 |
new String(shownConstructor.declaringClass.sourceName()), |
3986 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
3987 |
new String(shownConstructor.declaringClass.readableName()), |
3988 |
typesAsString(false, invocationArguments, false), |
3989 |
new String(inferredTypeArgument.readableName()), |
3990 |
new String(typeParameter.sourceName), |
3991 |
parameterBoundAsString(typeParameter, false) }, |
3992 |
new String[] { |
3993 |
new String(shownConstructor.declaringClass.sourceName()), |
3994 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
3995 |
new String(shownConstructor.declaringClass.shortReadableName()), |
3996 |
typesAsString(false, invocationArguments, true), |
3997 |
new String(inferredTypeArgument.shortReadableName()), |
3998 |
new String(typeParameter.sourceName), |
3999 |
parameterBoundAsString(typeParameter, true) }, |
4000 |
severity, |
4001 |
sourceStart, |
4002 |
sourceEnd); |
4003 |
return; |
4004 |
|
4005 |
case ProblemReasons.TypeParameterArityMismatch : |
4006 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
4007 |
shownConstructor = problemConstructor.closestMatch; |
4008 |
boolean noTypeVariables = shownConstructor.typeVariables == Binding.NO_TYPE_VARIABLES; |
4009 |
severity = computeSeverity(noTypeVariables ? IProblem.JavadocNonGenericConstructor : IProblem.JavadocIncorrectArityForParameterizedConstructor); |
4010 |
if (severity == ProblemSeverities.Ignore) return; |
4011 |
if (noTypeVariables) { |
4012 |
this.handle( |
4013 |
IProblem.JavadocNonGenericConstructor, |
4014 |
new String[] { |
4015 |
new String(shownConstructor.declaringClass.sourceName()), |
4016 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
4017 |
new String(shownConstructor.declaringClass.readableName()), |
4018 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
4019 |
new String[] { |
4020 |
new String(shownConstructor.declaringClass.sourceName()), |
4021 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
4022 |
new String(shownConstructor.declaringClass.shortReadableName()), |
4023 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
4024 |
severity, |
4025 |
sourceStart, |
4026 |
sourceEnd); |
4027 |
} else { |
4028 |
this.handle( |
4029 |
IProblem.JavadocIncorrectArityForParameterizedConstructor, |
4030 |
new String[] { |
4031 |
new String(shownConstructor.declaringClass.sourceName()), |
4032 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
4033 |
new String(shownConstructor.declaringClass.readableName()), |
4034 |
typesAsString(false, shownConstructor.typeVariables, false), |
4035 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
4036 |
new String[] { |
4037 |
new String(shownConstructor.declaringClass.sourceName()), |
4038 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
4039 |
new String(shownConstructor.declaringClass.shortReadableName()), |
4040 |
typesAsString(false, shownConstructor.typeVariables, true), |
4041 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
4042 |
severity, |
4043 |
sourceStart, |
4044 |
sourceEnd); |
4045 |
} |
4046 |
return; |
4047 |
case ProblemReasons.ParameterizedMethodTypeMismatch : |
4048 |
severity = computeSeverity(IProblem.JavadocParameterizedConstructorArgumentTypeMismatch); |
4049 |
if (severity == ProblemSeverities.Ignore) return; |
4050 |
problemConstructor = (ProblemMethodBinding) targetConstructor; |
4051 |
shownConstructor = problemConstructor.closestMatch; |
4052 |
this.handle( |
4053 |
IProblem.JavadocParameterizedConstructorArgumentTypeMismatch, |
4054 |
new String[] { |
4055 |
new String(shownConstructor.declaringClass.sourceName()), |
4056 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false), |
4057 |
new String(shownConstructor.declaringClass.readableName()), |
4058 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, false), |
4059 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) }, |
4060 |
new String[] { |
4061 |
new String(shownConstructor.declaringClass.sourceName()), |
4062 |
typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true), |
4063 |
new String(shownConstructor.declaringClass.shortReadableName()), |
4064 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownConstructor).typeArguments, true), |
4065 |
typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) }, |
4066 |
severity, |
4067 |
sourceStart, |
4068 |
sourceEnd); |
4069 |
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 |
3227 |
case ProblemReasons.NoError : // 0 |
4092 |
default : |
3228 |
default : |
4093 |
needImplementation(); // want to fail to see why we were here... |
3229 |
needImplementation(); // want to fail to see why we were here... |
Lines 4200-4324
Link Here
|
4200 |
case ProblemReasons.Ambiguous : |
3336 |
case ProblemReasons.Ambiguous : |
4201 |
id = IProblem.JavadocAmbiguousMethod; |
3337 |
id = IProblem.JavadocAmbiguousMethod; |
4202 |
break; |
3338 |
break; |
4203 |
case ProblemReasons.ParameterBoundMismatch : |
|
|
4204 |
int severity = computeSeverity(IProblem.JavadocGenericMethodTypeArgumentMismatch); |
4205 |
if (severity == ProblemSeverities.Ignore) return; |
4206 |
problemMethod = (ProblemMethodBinding) method; |
4207 |
ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch; |
4208 |
shownMethod = substitutedMethod.original(); |
4209 |
int augmentedLength = problemMethod.parameters.length; |
4210 |
TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2]; |
4211 |
TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1]; |
4212 |
TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end |
4213 |
System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2); |
4214 |
this.handle( |
4215 |
IProblem.JavadocGenericMethodTypeArgumentMismatch, |
4216 |
new String[] { |
4217 |
new String(shownMethod.selector), |
4218 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
4219 |
new String(shownMethod.declaringClass.readableName()), |
4220 |
typesAsString(false, invocationArguments, false), |
4221 |
new String(inferredTypeArgument.readableName()), |
4222 |
new String(typeParameter.sourceName), |
4223 |
parameterBoundAsString(typeParameter, false) }, |
4224 |
new String[] { |
4225 |
new String(shownMethod.selector), |
4226 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
4227 |
new String(shownMethod.declaringClass.shortReadableName()), |
4228 |
typesAsString(false, invocationArguments, true), |
4229 |
new String(inferredTypeArgument.shortReadableName()), |
4230 |
new String(typeParameter.sourceName), |
4231 |
parameterBoundAsString(typeParameter, true) }, |
4232 |
severity, |
4233 |
(int) (messageSend.nameSourcePosition >>> 32), |
4234 |
(int) messageSend.nameSourcePosition); |
4235 |
return; |
4236 |
case ProblemReasons.TypeParameterArityMismatch : |
4237 |
problemMethod = (ProblemMethodBinding) method; |
4238 |
shownMethod = problemMethod.closestMatch; |
4239 |
boolean noTypeVariables = shownMethod.typeVariables == Binding.NO_TYPE_VARIABLES; |
4240 |
severity = computeSeverity(noTypeVariables ? IProblem.JavadocNonGenericMethod : IProblem.JavadocIncorrectArityForParameterizedMethod); |
4241 |
if (severity == ProblemSeverities.Ignore) return; |
4242 |
if (noTypeVariables) { |
4243 |
this.handle( |
4244 |
IProblem.JavadocNonGenericMethod, |
4245 |
new String[] { |
4246 |
new String(shownMethod.selector), |
4247 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
4248 |
new String(shownMethod.declaringClass.readableName()), |
4249 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
4250 |
new String[] { |
4251 |
new String(shownMethod.selector), |
4252 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
4253 |
new String(shownMethod.declaringClass.shortReadableName()), |
4254 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
4255 |
severity, |
4256 |
(int) (messageSend.nameSourcePosition >>> 32), |
4257 |
(int) messageSend.nameSourcePosition); |
4258 |
} else { |
4259 |
this.handle( |
4260 |
IProblem.JavadocIncorrectArityForParameterizedMethod, |
4261 |
new String[] { |
4262 |
new String(shownMethod.selector), |
4263 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
4264 |
new String(shownMethod.declaringClass.readableName()), |
4265 |
typesAsString(false, shownMethod.typeVariables, false), |
4266 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
4267 |
new String[] { |
4268 |
new String(shownMethod.selector), |
4269 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
4270 |
new String(shownMethod.declaringClass.shortReadableName()), |
4271 |
typesAsString(false, shownMethod.typeVariables, true), |
4272 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
4273 |
severity, |
4274 |
(int) (messageSend.nameSourcePosition >>> 32), |
4275 |
(int) messageSend.nameSourcePosition); |
4276 |
} |
4277 |
return; |
4278 |
case ProblemReasons.ParameterizedMethodTypeMismatch : |
4279 |
severity = computeSeverity(IProblem.JavadocParameterizedMethodArgumentTypeMismatch); |
4280 |
if (severity == ProblemSeverities.Ignore) return; |
4281 |
problemMethod = (ProblemMethodBinding) method; |
4282 |
shownMethod = problemMethod.closestMatch; |
4283 |
this.handle( |
4284 |
IProblem.JavadocParameterizedMethodArgumentTypeMismatch, |
4285 |
new String[] { |
4286 |
new String(shownMethod.selector), |
4287 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
4288 |
new String(shownMethod.declaringClass.readableName()), |
4289 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, false), |
4290 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
4291 |
new String[] { |
4292 |
new String(shownMethod.selector), |
4293 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
4294 |
new String(shownMethod.declaringClass.shortReadableName()), |
4295 |
typesAsString(false, ((ParameterizedGenericMethodBinding)shownMethod).typeArguments, true), |
4296 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
4297 |
severity, |
4298 |
(int) (messageSend.nameSourcePosition >>> 32), |
4299 |
(int) messageSend.nameSourcePosition); |
4300 |
return; |
4301 |
case ProblemReasons.TypeArgumentsForRawGenericMethod : |
4302 |
severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericMethod); |
4303 |
if (severity == ProblemSeverities.Ignore) return; |
4304 |
problemMethod = (ProblemMethodBinding) method; |
4305 |
shownMethod = problemMethod.closestMatch; |
4306 |
this.handle( |
4307 |
IProblem.JavadocTypeArgumentsForRawGenericMethod, |
4308 |
new String[] { |
4309 |
new String(shownMethod.selector), |
4310 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false), |
4311 |
new String(shownMethod.declaringClass.readableName()), |
4312 |
typesAsString(method.isVarargs(), method.parameters, false) }, |
4313 |
new String[] { |
4314 |
new String(shownMethod.selector), |
4315 |
typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true), |
4316 |
new String(shownMethod.declaringClass.shortReadableName()), |
4317 |
typesAsString(method.isVarargs(), method.parameters, true) }, |
4318 |
severity, |
4319 |
(int) (messageSend.nameSourcePosition >>> 32), |
4320 |
(int) messageSend.nameSourcePosition); |
4321 |
return; |
4322 |
case ProblemReasons.NoError : // 0 |
3339 |
case ProblemReasons.NoError : // 0 |
4323 |
default : |
3340 |
default : |
4324 |
needImplementation(); // want to fail to see why we were here... |
3341 |
needImplementation(); // want to fail to see why we were here... |
Lines 4700-4718
Link Here
|
4700 |
nodeSourceStart(local, location), |
3717 |
nodeSourceStart(local, location), |
4701 |
nodeSourceEnd(local, location)); |
3718 |
nodeSourceEnd(local, location)); |
4702 |
} |
3719 |
} |
4703 |
public void methodMustOverride(AbstractMethodDeclaration method) { |
|
|
4704 |
MethodBinding binding = method.binding; |
4705 |
char[] methodSelector = binding.selector; |
4706 |
if(methodSelector == null) |
4707 |
methodSelector = method.getSafeName(); |
4708 |
|
4709 |
this.handle( |
4710 |
this.options.sourceLevel == ClassFileConstants.JDK1_5 ? IProblem.MethodMustOverride : IProblem.MethodMustOverrideOrImplement, |
4711 |
new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), }, |
4712 |
new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),}, |
4713 |
method.sourceStart, |
4714 |
method.sourceEnd); |
4715 |
} |
4716 |
public void methodNameClash(MethodBinding currentMethod, MethodBinding inheritedMethod) { |
3720 |
public void methodNameClash(MethodBinding currentMethod, MethodBinding inheritedMethod) { |
4717 |
this.handle( |
3721 |
this.handle( |
4718 |
IProblem.MethodNameClash, |
3722 |
IProblem.MethodNameClash, |
Lines 4758-4827
Link Here
|
4758 |
methodDecl.sourceStart, |
3762 |
methodDecl.sourceStart, |
4759 |
methodDecl.sourceEnd); |
3763 |
methodDecl.sourceEnd); |
4760 |
} |
3764 |
} |
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) { |
4802 |
this.handle( |
4803 |
IProblem.MissingEnumConstantCase, |
4804 |
new String[] {new String(enumConstant.declaringClass.readableName()), new String(enumConstant.name) }, |
4805 |
new String[] {new String(enumConstant.declaringClass.shortReadableName()), new String(enumConstant.name) }, |
4806 |
switchStatement.expression.sourceStart, |
4807 |
switchStatement.expression.sourceEnd); |
4808 |
} |
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) { |
3765 |
public void missingReturnType(AbstractMethodDeclaration methodDecl) { |
4826 |
this.handle( |
3766 |
this.handle( |
4827 |
IProblem.MissingReturnType, |
3767 |
IProblem.MissingReturnType, |
Lines 4848-4862
Link Here
|
4848 |
typeDecl.sourceStart, |
3788 |
typeDecl.sourceStart, |
4849 |
typeDecl.sourceEnd); |
3789 |
typeDecl.sourceEnd); |
4850 |
} |
3790 |
} |
4851 |
public void missingValueForAnnotationMember(Annotation annotation, char[] memberName) { |
|
|
4852 |
String memberString = new String(memberName); |
4853 |
this.handle( |
4854 |
IProblem.MissingValueForAnnotationMember, |
4855 |
new String[] {new String(annotation.resolvedType.readableName()), memberString }, |
4856 |
new String[] {new String(annotation.resolvedType.shortReadableName()), memberString}, |
4857 |
annotation.sourceStart, |
4858 |
annotation.sourceEnd); |
4859 |
} |
4860 |
public void mustDefineDimensionsOrInitializer(ArrayAllocationExpression expression) { |
3791 |
public void mustDefineDimensionsOrInitializer(ArrayAllocationExpression expression) { |
4861 |
this.handle( |
3792 |
this.handle( |
4862 |
IProblem.MustDefineEitherDimensionExpressionsOrInitializer, |
3793 |
IProblem.MustDefineEitherDimensionExpressionsOrInitializer, |
Lines 5208-5221
Link Here
|
5208 |
expression.sourceStart, |
4139 |
expression.sourceStart, |
5209 |
expression.sourceEnd); |
4140 |
expression.sourceEnd); |
5210 |
} |
4141 |
} |
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) { |
4142 |
public void objectCannotHaveSuperTypes(SourceTypeBinding type) { |
5220 |
this.handle( |
4143 |
this.handle( |
5221 |
IProblem.ObjectCannotHaveSuperTypes, |
4144 |
IProblem.ObjectCannotHaveSuperTypes, |
Lines 6015-6032
Link Here
|
6015 |
decl.sourceStart, |
4938 |
decl.sourceStart, |
6016 |
decl.sourceEnd); |
4939 |
decl.sourceEnd); |
6017 |
} |
4940 |
} |
6018 |
public void superTypeCannotUseWildcard(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) { |
|
|
6019 |
String name = new String(type.sourceName()); |
6020 |
String superTypeFullName = new String(superTypeBinding.readableName()); |
6021 |
String superTypeShortName = new String(superTypeBinding.shortReadableName()); |
6022 |
if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName; |
6023 |
this.handle( |
6024 |
IProblem.SuperTypeUsingWildcard, |
6025 |
new String[] {superTypeFullName, name}, |
6026 |
new String[] {superTypeShortName, name}, |
6027 |
superclass.sourceStart, |
6028 |
superclass.sourceEnd); |
6029 |
} |
6030 |
private void syntaxError( |
4941 |
private void syntaxError( |
6031 |
int id, |
4942 |
int id, |
6032 |
int startPosition, |
4943 |
int startPosition, |
Lines 6130-6171
Link Here
|
6130 |
typeDecl.sourceEnd, |
5041 |
typeDecl.sourceEnd, |
6131 |
compUnitDecl.compilationResult); |
5042 |
compUnitDecl.compilationResult); |
6132 |
} |
5043 |
} |
6133 |
public void typeHiding(TypeDeclaration typeDecl, TypeVariableBinding hiddenTypeParameter) { |
|
|
6134 |
int severity = computeSeverity(IProblem.TypeHidingTypeParameterFromType); |
6135 |
if (severity == ProblemSeverities.Ignore) return; |
6136 |
if (hiddenTypeParameter.declaringElement instanceof TypeBinding) { |
6137 |
TypeBinding declaringType = (TypeBinding) hiddenTypeParameter.declaringElement; |
6138 |
this.handle( |
6139 |
IProblem.TypeHidingTypeParameterFromType, |
6140 |
new String[] { new String(typeDecl.name) , new String(hiddenTypeParameter.readableName()), new String(declaringType.readableName()) }, |
6141 |
new String[] { new String(typeDecl.name) , new String(hiddenTypeParameter.shortReadableName()), new String(declaringType.shortReadableName()) }, |
6142 |
severity, |
6143 |
typeDecl.sourceStart, |
6144 |
typeDecl.sourceEnd); |
6145 |
} else { |
6146 |
// type parameter of generic method |
6147 |
MethodBinding declaringMethod = (MethodBinding) hiddenTypeParameter.declaringElement; |
6148 |
this.handle( |
6149 |
IProblem.TypeHidingTypeParameterFromMethod, |
6150 |
new String[] { |
6151 |
new String(typeDecl.name), |
6152 |
new String(hiddenTypeParameter.readableName()), |
6153 |
new String(declaringMethod.selector), |
6154 |
typesAsString(declaringMethod.isVarargs(), declaringMethod.parameters, false), |
6155 |
new String(declaringMethod.declaringClass.readableName()), |
6156 |
}, |
6157 |
new String[] { |
6158 |
new String(typeDecl.name), |
6159 |
new String(hiddenTypeParameter.shortReadableName()), |
6160 |
new String(declaringMethod.selector), |
6161 |
typesAsString(declaringMethod.isVarargs(), declaringMethod.parameters, true), |
6162 |
new String(declaringMethod.declaringClass.shortReadableName()), |
6163 |
}, |
6164 |
severity, |
6165 |
typeDecl.sourceStart, |
6166 |
typeDecl.sourceEnd); |
6167 |
} |
6168 |
} |
6169 |
public void typeHiding(TypeDeclaration typeDecl, TypeBinding hiddenType) { |
5044 |
public void typeHiding(TypeDeclaration typeDecl, TypeBinding hiddenType) { |
6170 |
int severity = computeSeverity(IProblem.TypeHidingType); |
5045 |
int severity = computeSeverity(IProblem.TypeHidingType); |
6171 |
if (severity == ProblemSeverities.Ignore) return; |
5046 |
if (severity == ProblemSeverities.Ignore) return; |
Lines 6197-6220
Link Here
|
6197 |
location.sourceStart, |
5072 |
location.sourceStart, |
6198 |
location.sourceEnd); |
5073 |
location.sourceEnd); |
6199 |
} |
5074 |
} |
6200 |
public void typeMismatchError(TypeBinding typeArgument, TypeVariableBinding typeParameter, ReferenceBinding genericType, ASTNode location) { |
|
|
6201 |
if (location == null) { // binary case |
6202 |
this.handle( |
6203 |
IProblem.TypeArgumentMismatch, |
6204 |
new String[] { new String(typeArgument.readableName()), new String(genericType.readableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, false) }, |
6205 |
new String[] { new String(typeArgument.shortReadableName()), new String(genericType.shortReadableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, true) }, |
6206 |
ProblemSeverities.AbortCompilation | ProblemSeverities.Error | ProblemSeverities.Fatal, |
6207 |
0, |
6208 |
0); |
6209 |
return; |
6210 |
} |
6211 |
this.handle( |
6212 |
IProblem.TypeArgumentMismatch, |
6213 |
new String[] { new String(typeArgument.readableName()), new String(genericType.readableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, false) }, |
6214 |
new String[] { new String(typeArgument.shortReadableName()), new String(genericType.shortReadableName()), new String(typeParameter.sourceName), parameterBoundAsString(typeParameter, true) }, |
6215 |
location.sourceStart, |
6216 |
location.sourceEnd); |
6217 |
} |
6218 |
private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) { |
5075 |
private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) { |
6219 |
StringBuffer buffer = new StringBuffer(10); |
5076 |
StringBuffer buffer = new StringBuffer(10); |
6220 |
for (int i = 0, length = types.length; i < length; i++) { |
5077 |
for (int i = 0, length = types.length; i < length; i++) { |
Lines 6228-6243
Link Here
|
6228 |
} |
5085 |
} |
6229 |
return buffer.toString(); |
5086 |
return buffer.toString(); |
6230 |
} |
5087 |
} |
6231 |
public void undefinedAnnotationValue(TypeBinding annotationType, MemberValuePair memberValuePair) { |
|
|
6232 |
if (isRecoveredName(memberValuePair.name)) return; |
6233 |
String name = new String(memberValuePair.name); |
6234 |
this.handle( |
6235 |
IProblem.UndefinedAnnotationMember, |
6236 |
new String[] { name, new String(annotationType.readableName())}, |
6237 |
new String[] { name, new String(annotationType.shortReadableName())}, |
6238 |
memberValuePair.sourceStart, |
6239 |
memberValuePair.sourceEnd); |
6240 |
} |
6241 |
public void undefinedLabel(BranchStatement statement) { |
5088 |
public void undefinedLabel(BranchStatement statement) { |
6242 |
if (isRecoveredName(statement.label)) return; |
5089 |
if (isRecoveredName(statement.label)) return; |
6243 |
String[] arguments = new String[] {new String(statement.label)}; |
5090 |
String[] arguments = new String[] {new String(statement.label)}; |
Lines 6304-6318
Link Here
|
6304 |
location.sourceStart, |
5151 |
location.sourceStart, |
6305 |
location.sourceEnd); |
5152 |
location.sourceEnd); |
6306 |
} |
5153 |
} |
6307 |
public void unhandledWarningToken(Expression token) { |
|
|
6308 |
String[] arguments = new String[] { token.constant.stringValue() }; |
6309 |
this.handle( |
6310 |
IProblem.UnhandledWarningToken, |
6311 |
arguments, |
6312 |
arguments, |
6313 |
token.sourceStart, |
6314 |
token.sourceEnd); |
6315 |
} |
6316 |
public void uninitializedBlankFinalField(FieldBinding field, ASTNode location) { |
5154 |
public void uninitializedBlankFinalField(FieldBinding field, ASTNode location) { |
6317 |
String[] arguments = new String[] {new String(field.readableName())}; |
5155 |
String[] arguments = new String[] {new String(field.readableName())}; |
6318 |
this.handle( |
5156 |
this.handle( |
Lines 6753-6825
Link Here
|
6753 |
sourceStart, |
5591 |
sourceStart, |
6754 |
sourceEnd); |
5592 |
sourceEnd); |
6755 |
} |
5593 |
} |
6756 |
public void varargsArgumentNeedCast(MethodBinding method, TypeBinding argumentType, InvocationSite location) { |
|
|
6757 |
int severity = this.options.getSeverity(CompilerOptions.VarargsArgumentNeedCast); |
6758 |
if (severity == ProblemSeverities.Ignore) return; |
6759 |
ArrayBinding varargsType = (ArrayBinding)method.parameters[method.parameters.length-1]; |
6760 |
if (method.isConstructor()) { |
6761 |
this.handle( |
6762 |
IProblem.ConstructorVarargsArgumentNeedCast, |
6763 |
new String[] { |
6764 |
new String(argumentType.readableName()), |
6765 |
new String(varargsType.readableName()), |
6766 |
new String(method.declaringClass.readableName()), |
6767 |
typesAsString(method.isVarargs(), method.parameters, false), |
6768 |
new String(varargsType.elementsType().readableName()), |
6769 |
}, |
6770 |
new String[] { |
6771 |
new String(argumentType.shortReadableName()), |
6772 |
new String(varargsType.shortReadableName()), |
6773 |
new String(method.declaringClass.shortReadableName()), |
6774 |
typesAsString(method.isVarargs(), method.parameters, true), |
6775 |
new String(varargsType.elementsType().shortReadableName()), |
6776 |
}, |
6777 |
severity, |
6778 |
location.sourceStart(), |
6779 |
location.sourceEnd()); |
6780 |
} else { |
6781 |
this.handle( |
6782 |
IProblem.MethodVarargsArgumentNeedCast, |
6783 |
new String[] { |
6784 |
new String(argumentType.readableName()), |
6785 |
new String(varargsType.readableName()), |
6786 |
new String(method.selector), |
6787 |
typesAsString(method.isVarargs(), method.parameters, false), |
6788 |
new String(method.declaringClass.readableName()), |
6789 |
new String(varargsType.elementsType().readableName()), |
6790 |
}, |
6791 |
new String[] { |
6792 |
new String(argumentType.shortReadableName()), |
6793 |
new String(varargsType.shortReadableName()), |
6794 |
new String(method.selector), typesAsString(method.isVarargs(), method.parameters, true), |
6795 |
new String(method.declaringClass.shortReadableName()), |
6796 |
new String(varargsType.elementsType().shortReadableName()), |
6797 |
}, |
6798 |
severity, |
6799 |
location.sourceStart(), |
6800 |
location.sourceEnd()); |
6801 |
} |
6802 |
} |
6803 |
public void varargsConflict(MethodBinding method1, MethodBinding method2, SourceTypeBinding type) { |
6804 |
this.handle( |
6805 |
IProblem.VarargsConflict, |
6806 |
new String[] { |
6807 |
new String(method1.selector), |
6808 |
typesAsString(method1.isVarargs(), method1.parameters, false), |
6809 |
new String(method1.declaringClass.readableName()), |
6810 |
typesAsString(method2.isVarargs(), method2.parameters, false), |
6811 |
new String(method2.declaringClass.readableName()) |
6812 |
}, |
6813 |
new String[] { |
6814 |
new String(method1.selector), |
6815 |
typesAsString(method1.isVarargs(), method1.parameters, true), |
6816 |
new String(method1.declaringClass.shortReadableName()), |
6817 |
typesAsString(method2.isVarargs(), method2.parameters, true), |
6818 |
new String(method2.declaringClass.shortReadableName()) |
6819 |
}, |
6820 |
method1.declaringClass == type ? method1.sourceStart() : type.sourceStart(), |
6821 |
method1.declaringClass == type ? method1.sourceEnd() : type.sourceEnd()); |
6822 |
} |
6823 |
public void variableTypeCannotBeVoid(AbstractVariableDeclaration varDecl) { |
5594 |
public void variableTypeCannotBeVoid(AbstractVariableDeclaration varDecl) { |
6824 |
String[] arguments = new String[] {new String(varDecl.name)}; |
5595 |
String[] arguments = new String[] {new String(varDecl.name)}; |
6825 |
this.handle( |
5596 |
this.handle( |